#include #include #include int note(void*, char *msg) { int id; id = threadid(); sysfatal("%d: %s", id, msg); return NDFLT; } void usage(void) { fprint(2, "usage: %s\n", argv0); threadexitsall("usage"); } void threadmain(int argc, char *argv[]) { ARGBEGIN{ default: usage(); }ARGEND threadnotify(note, 1); alarm(500); sleep(1000); threadexitsall(nil); }