MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / execute

Method execute

extern/libcds/cds/urcu/dispose_thread.h:73–106  ·  view source on GitHub ↗

methods called from disposing thread @cond

Source from the content-addressed store, hash-verified

71 private: // methods called from disposing thread
72 //@cond
73 void execute()
74 {
75 buffer_type * pBuffer;
76 uint64_t nCurEpoch;
77 bool bQuit = false;
78
79 while ( !bQuit ) {
80
81 // signal that we are ready to dispose
82 {
83 unique_lock lock( m_Mutex );
84 m_bReady = true;
85 }
86 m_cvReady.notify_one();
87
88 {
89 // wait new data portion
90 unique_lock lock( m_Mutex );
91
92 while ( (pBuffer = m_pBuffer.load( atomics::memory_order_relaxed )) == nullptr )
93 m_cvDataReady.wait( lock );
94
95 // New work is ready
96 m_bReady = false; // we are busy
97
98 bQuit = m_bQuit;
99 nCurEpoch = m_nCurEpoch;
100 m_pBuffer.store( nullptr, atomics::memory_order_relaxed );
101 }
102
103 if ( pBuffer )
104 dispose_buffer( pBuffer, nCurEpoch );
105 }
106 }
107
108 void dispose_buffer( buffer_type * pBuf, uint64_t nCurEpoch )
109 {

Callers 1

thread_funcMethod · 0.45

Calls 4

notify_oneMethod · 0.45
loadMethod · 0.45
waitMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected