MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / tryWait

Method tryWait

kernel/orbis/src/evf.cpp:98–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98orbis::ErrorCode orbis::EventFlag::tryWait(Thread *thread,
99 std::uint8_t waitMode,
100 std::uint64_t bitPattern) {
101 rx::writer_lock lock(queueMtx);
102
103 if (isDeleted) {
104 return ErrorCode::ACCES;
105 }
106
107 auto waitingThread =
108 WaitingThread{.bitPattern = bitPattern, .waitMode = waitMode};
109
110 if (auto patValue = value.load(std::memory_order::relaxed);
111 waitingThread.test(patValue)) {
112 auto resultValue = waitingThread.applyClear(patValue);
113 value.store(resultValue, std::memory_order::relaxed);
114 thread->evfResultPattern = patValue;
115 return {};
116 }
117
118 return ErrorCode::BUSY;
119}
120
121std::size_t orbis::EventFlag::notify(NotifyType type, std::uint64_t bits) {
122 rx::writer_lock lock(queueMtx);

Callers 2

sys_evf_trywaitMethod · 0.80

Calls 4

applyClearMethod · 0.80
loadMethod · 0.45
testMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected