Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
langc
void func(void *foo) {
  /* Execution of thread */
}

int main(void) {
  int result;
  pthread_t thread;

  if ((result = pthread_create(&thread, NULL, func, 0)) != 0) {
    /* Handle Error */
  }
  if ((result = pthread_kill(thread, SIGKILL)) != 0) {
    /* Handle Error */
  }

  /* Continue executing until the signal kills the process */

  return 0;
}

...