MCPcopy Create free account
hub / github.com/apache/brpc / wakeup_pthread

Function wakeup_pthread

src/bthread/butex.cpp:136–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134namespace bthread {
135
136static void wakeup_pthread(ButexPthreadWaiter* pw) {
137 // release fence makes wait_pthread see changes before wakeup.
138 pw->sig.store(PTHREAD_SIGNALLED, butil::memory_order_release);
139 // At this point, wait_pthread() possibly has woken up and destroyed `pw'.
140 // In which case, futex_wake_private() should return EFAULT.
141 // If crash happens in future, `pw' can be made TLS and never destroyed
142 // to solve the issue.
143 futex_wake_private(&pw->sig, 1);
144}
145
146bool erase_from_butex(ButexWaiter*, bool, WaiterState);
147

Callers 5

butex_wakeFunction · 0.85
butex_wake_nFunction · 0.85
butex_wake_exceptFunction · 0.85
butex_requeueFunction · 0.85
erase_from_butexFunction · 0.85

Calls 2

futex_wake_privateFunction · 0.70
storeMethod · 0.45

Tested by

no test coverage detected