{
api_error_code nErr;
void * pData = ::TlsGetValue( m_key );
- if ( pData == NULL && (nErr = ::GetLastError()) != ERROR_SUCCESS )
+ if ( pData == nullptr && (nErr = ::GetLastError()) != ERROR_SUCCESS )
throw api_exception( nErr, "TlsGetValue" );
return reinterpret_cast<ThreadData *>( pData );
}
static void free()
{
ThreadData * p = get();
- ::TlsSetValue( m_key, NULL );
+ ::TlsSetValue( m_key, nullptr );
if ( p )
delete p;
}
# ifdef _DEBUG
{
ThreadData * p = Holder::get();
- assert( p != NULL );
+ assert( p );
return p;
}
# else
case do_checkData:
return Holder::get();
case do_attachThread:
- if ( Holder::get() == NULL )
+ if ( Holder::get() == nullptr )
Holder::alloc();
return Holder::get();
case do_detachThread:
Holder::free();
- return NULL;
+ return nullptr;
default:
assert( false ) ; // anything forgotten?..
}
- return NULL;
+ return nullptr;
}
//@endcond
/// Checks whether current thread is attached to \p libcds feature or not.
static bool isThreadAttached()
{
- return _threadData( do_checkData ) != NULL;
+ return _threadData( do_checkData ) != nullptr;
}
/// This method must be called in beginning of thread execution
/**
- If TLS pointer to manager's data is NULL, api_exception is thrown
+ If TLS pointer to manager's data is \p nullptr, api_exception is thrown
with code = -1.
If an error occurs in call of Win TLS API function, api_exception is thrown
with Windows error code.
static void attachThread()
{
ThreadData * pData = _threadData( do_attachThread );
- assert( pData != NULL );
+ assert( pData );
if ( pData ) {
pData->init();
/// This method must be called in end of thread execution
/**
- If TLS pointer to manager's data is NULL, api_exception is thrown
+ If TLS pointer to manager's data is \p nullptr, api_exception is thrown
with code = -1.
If an error occurs in call of Win TLS API function, api_exception is thrown
with Windows error code.
static void detachThread()
{
ThreadData * pData = _threadData( do_getData );
- assert( pData != NULL );
+ assert( pData );
if ( pData ) {
if ( pData->fini() )