aboutsummaryrefslogblamecommitdiff
path: root/example/raise2.c
blob: 056a341701ba54ca38ed3b185d85c8d5e8148756 (plain) (tree)
























                                          
#include <pthread.h>
#include <signal.h>

// 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);
}