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

Function pthread_kill

system/lib/pthread/pthread_kill.c:19–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19int pthread_kill(pthread_t t, int sig) {
20 if (sig < 0 || sig >= _NSIG) {
21 return EINVAL;
22 }
23 if (!t || !_emscripten_thread_is_valid(t)) {
24 return ESRCH;
25 }
26 if (sig == 0) return 0; // signal == 0 is a no-op.
27
28 // The job of pthread_kill is basically to run the (process-wide) signal
29 // handler on the target thread.
30 if (pthread_equal(pthread_self(), t)) {
31 raise(sig);
32 } else {
33 emscripten_proxy_async(emscripten_proxy_get_system_queue(), t, proxied_raise, (void*)(intptr_t)sig);
34 }
35 return 0;
36}

Callers 4

mainFunction · 0.50
mainFunction · 0.50
thread_startFunction · 0.50
mainFunction · 0.50

Calls 5

pthread_equalFunction · 0.85
emscripten_proxy_asyncFunction · 0.70
raiseFunction · 0.50

Tested by 4

mainFunction · 0.40
mainFunction · 0.40
thread_startFunction · 0.40
mainFunction · 0.40