MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / unlock_shared

Method unlock_shared

system/lib/libcxx/src/shared_mutex.cpp:71–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void __shared_mutex_base::unlock_shared() {
72 unique_lock<mutex> lk(__mut_);
73 unsigned num_readers = (__state_ & __n_readers_) - 1;
74 __state_ &= ~__n_readers_;
75 __state_ |= num_readers;
76 if (__state_ & __write_entered_) {
77 if (num_readers == 0) {
78 lk.unlock();
79 __gate2_.notify_one();
80 }
81 } else {
82 if (num_readers == __n_readers_ - 1) {
83 lk.unlock();
84 __gate1_.notify_one();
85 }
86 }
87}
88
89// Shared Timed Mutex
90// These routines are here for ABI stability

Callers 2

findFDEMethod · 0.80

Calls 2

unlockMethod · 0.45
notify_oneMethod · 0.45

Tested by

no test coverage detected