Replace NULL with nullptr
[libcds.git] / cds / gc / hrc / hrc.h
index 743248e574bd960335a55899d77f84a88b504a2e..068adecd239e9b627d4686f65b4b3698888b8a89 100644 (file)
@@ -130,7 +130,7 @@ namespace cds { namespace gc {
                     for all x where link[x] of node is reference-counted do
                 retry:
                         node1 := link[x];
-                        if node1 != NULL and node1.m_bDeleted then
+                        if node1 != nullptr and node1.m_bDeleted then
                             node2 := node1->link[x];
                             pGC->CASRef( this->link[x], node1, node2 );
                             pGC->releaseRef( node2 );
@@ -159,11 +159,11 @@ namespace cds { namespace gc {
                 void terminate( ThreadGC * pGC, bool bConcurrent)
                     if !bConcurrent
                         for all this->link where link is reference-counted do
-                            link := NULL;
+                            link := nullptr;
                     else
                         for all this->link where link is reference-counted do
                             repeat node1 := link;
-                            until pGC->CASRef(link,node1,NULL);
+                            until pGC->CASRef(link,node1,nullptr);
                 \endcode
             */
             virtual void    terminate( ThreadGC * pGC, bool bConcurrent ) = 0;
@@ -262,7 +262,7 @@ namespace cds { namespace gc {
 #endif
             };
 
-            /// "Global GC object is NULL" exception
+            /// "Global GC object is nullptr" exception
             CDS_DECLARE_EXCEPTION( HRCGarbageCollectorEmpty, "Global cds::gc::hrc::GarbageCollector is NULL" );
 
             /// Not enough required Hazard Pointer count
@@ -294,7 +294,7 @@ namespace cds { namespace gc {
             {
                 thread_list_node *  m_pNext     ; ///< next list record
                 ThreadGC *          m_pOwner    ; ///< Owner of record
-                CDS_ATOMIC::atomic<std::thread::id>   m_idOwner   ; ///< Id of thread owned; 0 - record is free
+                CDS_ATOMIC::atomic<cds::OS::ThreadId>   m_idOwner   ; ///< Id of thread owned; 0 - record is free
                 bool                m_bFree        ; ///< Node is help-scanned
 
                 //@cond
@@ -302,14 +302,14 @@ namespace cds { namespace gc {
                     : thread_descriptor( HzpMgr ),
                     m_pNext( nullptr ),
                     m_pOwner( nullptr ),
-                    m_idOwner( std::thread::id() ),
+                    m_idOwner(cds::OS::c_NullThreadId),
                     m_bFree( false )
                 {}
 
                 ~thread_list_node()
                 {
                     assert( m_pOwner == nullptr );
-                    assert( m_idOwner.load( CDS_ATOMIC::memory_order_relaxed ) == std::thread::id() );
+                    assert( m_idOwner.load( CDS_ATOMIC::memory_order_relaxed ) == cds::OS::c_NullThreadId );
                 }
                 //@endcond
             };