Skip to content

Instantly share code, notes, and snippets.

@thestinger
Created May 5, 2021 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thestinger/2a1dd1c0850dd3e6721732131907f497 to your computer and use it in GitHub Desktop.
Save thestinger/2a1dd1c0850dd3e6721732131907f497 to your computer and use it in GitHub Desktop.
#include <threads.h>
#include <stdio.h>
#include <stdlib.h>
static void rest() {
rest();
}
static int dilemma(void *p) {
rest();
puts("launch nukes");
exit(1);
}
int main(void) {
thrd_t worker;
thrd_create(&worker, dilemma, NULL);
while (1) {
putchar('a');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment