aboutsummaryrefslogtreecommitdiffstats
path: root/erts/lib_src/pthread/ethread.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-12-04 11:04:23 +0100
committerLukas Larsson <[email protected]>2014-12-19 10:39:52 +0100
commitb8a2313263d0f120dacbe82ced5c99545bbd15a3 (patch)
treed77376ce678171c430740e00904a32044f350bb0 /erts/lib_src/pthread/ethread.c
parentd6d1ef4787951070dd152daf44eff2003b7f2ed2 (diff)
downloadotp-b8a2313263d0f120dacbe82ced5c99545bbd15a3.tar.gz
otp-b8a2313263d0f120dacbe82ced5c99545bbd15a3.tar.bz2
otp-b8a2313263d0f120dacbe82ced5c99545bbd15a3.zip
erts: Introduce thread suspend functions
These functions allow any thread to suspend any other thread immediately and then resume all threads. This is useful when doing a crash dump in order to get a more accurate picture of what state the system is in.
Diffstat (limited to 'erts/lib_src/pthread/ethread.c')
-rw-r--r--erts/lib_src/pthread/ethread.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/erts/lib_src/pthread/ethread.c b/erts/lib_src/pthread/ethread.c
index 340d085428..7cf38580c5 100644
--- a/erts/lib_src/pthread/ethread.c
+++ b/erts/lib_src/pthread/ethread.c
@@ -600,6 +600,17 @@ int ethr_sigwait(const sigset_t *set, int *sig)
return 0;
}
+int ethr_kill(const ethr_tid tid, const int sig)
+{
+#if ETHR_XCHK
+ if (ethr_not_inited__) {
+ ETHR_ASSERT(0);
+ return EACCES;
+ }
+#endif
+ return pthread_kill((const pthread_t)tid, sig);
+}
+
#endif /* #if ETHR_HAVE_ETHR_SIG_FUNCS */
ETHR_IMPL_NORETURN__