Replace NULL with nullptr
[libcds.git] / cds / threading / details / pthread_manager.h
index 3ed88ccdabbb75b7687cfb2620304409c685abee..fbc970590c15d55947788baa3e98ddf06de47d6b 100644 (file)
@@ -79,7 +79,7 @@ namespace cds { namespace threading {
                 static void free()
                 {
                     ThreadData * p = get();
-                    pthread_setspecific( m_key, NULL );
+                    pthread_setspecific( m_key, nullptr );
                     if ( p )
                         delete p;
                 }
@@ -106,12 +106,12 @@ namespace cds { namespace threading {
                     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;
                     case init_holder:
                     case fini_holder:
                         break;
@@ -119,7 +119,7 @@ namespace cds { namespace threading {
                         assert( false ) ;   // anything forgotten?..
                 }
                 assert(false)   ;   // how did we get here?
-                return NULL;
+                return nullptr;
             }
             //@endcond
 
@@ -145,12 +145,12 @@ namespace cds { namespace threading {
             /// 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, pthread_exception is thrown
+                If TLS pointer to manager's data is \p nullptr, pthread_exception is thrown
                 with code = -1.
                 If an error occurs in call of pthread API function, pthread_exception is thrown
                 with pthread error code.
@@ -158,7 +158,7 @@ namespace cds { namespace threading {
             static void attachThread()
             {
                 ThreadData * pData = _threadData( do_attachThread );
-                assert( pData != NULL );
+                assert( pData );
 
                 if ( pData ) {
                     pData->init();
@@ -169,7 +169,7 @@ namespace cds { namespace threading {
 
             /// This method must be called in end of thread execution
             /**
-                If TLS pointer to manager's data is NULL, pthread_exception is thrown
+                If TLS pointer to manager's data is \p nullptr, pthread_exception is thrown
                 with code = -1.
                 If an error occurs in call of pthread API function, pthread_exception is thrown
                 with pthread error code.
@@ -177,7 +177,7 @@ namespace cds { namespace threading {
             static void detachThread()
             {
                 ThreadData * pData = _threadData( do_getData );
-                assert( pData != NULL );
+                assert( pData );
 
                 if ( pData ) {
                     if ( pData->fini() )