#include <new>
#include "GlobalBlockerPool.h"
status_t
GlobalBlockerPool::CreateDefault()
{
if (sPool)
return B_OK;
BlockerPool* pool = new(std::nothrow) BlockerPool;
if (!pool)
return B_NO_MEMORY;
status_t error = pool->InitCheck();
if (error != B_OK) {
delete pool;
return error;
}
sPool = pool;
return B_OK;
}
void
GlobalBlockerPool::DeleteDefault()
{
if (sPool) {
delete sPool;
sPool = NULL;
}
}
BlockerPool*
GlobalBlockerPool::GetDefault()
{
return sPool;
}
BlockerPool* GlobalBlockerPool::sPool = NULL;