MCPcopy Create free account
hub / github.com/Inori/GPCS4 / pthread_kill

Function pthread_kill

3rdParty/winpthreads/src/thread.c:1300–1319  ·  view source on GitHub ↗

half-stubbed version as we don't really well support signals */

Source from the content-addressed store, hash-verified

1298
1299/* half-stubbed version as we don't really well support signals */
1300int
1301pthread_kill (pthread_t t, int sig)
1302{
1303 struct _pthread_v *tv;
1304
1305 pthread_mutex_lock (&mtx_pthr_locked);
1306 tv = __pthread_get_pointer (t);
1307 if (!tv || t != tv->x || tv->in_cancel || tv->ended || tv->h == NULL
1308 || tv->h == INVALID_HANDLE_VALUE)
1309 {
1310 pthread_mutex_unlock (&mtx_pthr_locked);
1311 return ESRCH;
1312 }
1313 pthread_mutex_unlock (&mtx_pthr_locked);
1314 if (!sig)
1315 return 0;
1316 if (sig < SIGINT || sig > NSIG)
1317 return EINVAL;
1318 return pthread_cancel(t);
1319}
1320
1321unsigned
1322_pthread_get_state (const pthread_attr_t *attr, unsigned flag)

Callers

nothing calls this directly

Calls 4

pthread_mutex_lockFunction · 0.85
__pthread_get_pointerFunction · 0.85
pthread_mutex_unlockFunction · 0.85
pthread_cancelFunction · 0.85

Tested by

no test coverage detected