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

Function bthread_cond_signal

src/bthread/condition_variable.cpp:61–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61int bthread_cond_signal(bthread_cond_t* c) {
62 bthread::CondInternal* ic = reinterpret_cast<bthread::CondInternal*>(c);
63 // ic is probably dereferenced after fetch_add, save required fields before
64 // this point
65 butil::atomic<int>* const saved_seq = ic->seq;
66 saved_seq->fetch_add(1, butil::memory_order_release);
67 // don't touch ic any more
68 bthread::butex_wake(saved_seq);
69 return 0;
70}
71
72int bthread_cond_broadcast(bthread_cond_t* c) {
73 bthread::CondInternal* ic = reinterpret_cast<bthread::CondInternal*>(c);

Callers 4

signalerFunction · 0.85
TESTFunction · 0.85
SignalMethod · 0.85
notify_oneMethod · 0.85

Calls 2

butex_wakeFunction · 0.85
fetch_addMethod · 0.80

Tested by 3

signalerFunction · 0.68
TESTFunction · 0.68
SignalMethod · 0.68