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

Method sendSignal

kernel/orbis/src/KernelContext.cpp:80–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78void Thread::resume() { sendSignal(-2); }
79
80void Thread::sendSignal(int signo) {
81 if (signo >= 0) {
82 if (!sigMask.test(signo)) {
83 return;
84 }
85 }
86
87 // TODO: suspend uses another delivery confirmation
88 if (signo != -1) {
89 interruptedMtx.store(1, std::memory_order::release);
90
91 if (pthread_sigqueue(getNativeHandle(), SIGUSR1, {.sival_int = signo})) {
92 perror("pthread_sigqueue");
93 }
94
95 while (interruptedMtx.wait(1, std::chrono::microseconds(1000)) !=
96 std::errc{}) {
97 if (interruptedMtx.load() == 0) {
98 return;
99 }
100
101 if (pthread_sigqueue(getNativeHandle(), SIGUSR1, {.sival_int = -2})) {
102 perror("pthread_sigqueue");
103 }
104 }
105 } else {
106 if (pthread_sigqueue(getNativeHandle(), SIGUSR1, {.sival_int = signo})) {
107 perror("pthread_sigqueue");
108 }
109 }
110}
111
112void Thread::notifyUnblockedSignal(int signo) {
113 for (std::size_t i = 0; i < blockedSignals.size();) {

Callers 2

thr_killFunction · 0.80
nosysMethod · 0.80

Calls 4

testMethod · 0.45
storeMethod · 0.45
waitMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected