mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 22:47:03 +00:00
orbis: propagate SIGSEGV, SIGBUS and SIGFPE in userspace to guest handler
fix minor race fix signal delivery without handler freeze
This commit is contained in:
parent
70fa577a7b
commit
f7651d7eae
4 changed files with 96 additions and 39 deletions
|
|
@ -325,14 +325,14 @@ void Thread::sendSignal(int signo) {
|
|||
}
|
||||
}
|
||||
|
||||
if (pthread_sigqueue(getNativeHandle(), SIGUSR1, {.sival_int = signo})) {
|
||||
perror("pthread_sigqueue");
|
||||
}
|
||||
|
||||
|
||||
// TODO: suspend uses another delivery confirmation
|
||||
if (signo != -1) {
|
||||
interruptedMtx.store(1, std::memory_order::release);
|
||||
|
||||
if (pthread_sigqueue(getNativeHandle(), SIGUSR1, {.sival_int = signo})) {
|
||||
perror("pthread_sigqueue");
|
||||
}
|
||||
|
||||
while (interruptedMtx.wait(1, std::chrono::microseconds(1000)) !=
|
||||
std::errc{}) {
|
||||
if (interruptedMtx.load() == 0) {
|
||||
|
|
@ -343,6 +343,10 @@ void Thread::sendSignal(int signo) {
|
|||
perror("pthread_sigqueue");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (pthread_sigqueue(getNativeHandle(), SIGUSR1, {.sival_int = signo})) {
|
||||
perror("pthread_sigqueue");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue