From fe0c58e5fbaa37668779ec10d2761e6657b824f4 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Mon, 9 Sep 2024 22:58:51 +0200 Subject: initial commit of libbt --- example/raise2.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 example/raise2.c (limited to 'example/raise2.c') diff --git a/example/raise2.c b/example/raise2.c new file mode 100644 index 0000000..056a341 --- /dev/null +++ b/example/raise2.c @@ -0,0 +1,25 @@ +#include +#include + +// Raise from different thread. + +void foo() { + raise(SIGSEGV); +} +void bar() { + foo(); +} +void qux() { + bar(); +} + +void* thread(void*) { + qux(); + return 0; +} + +int main() { + pthread_t th; + pthread_create(&th, NULL, thread, NULL); + pthread_join(th, NULL); +} -- cgit v1.2.3