mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
155b378a39
The organization of the source files is now much more rational. Old experiments that didn't work out are now deleted. Naming of things like files is now more intuitive.
33 lines
1.2 KiB
C
33 lines
1.2 KiB
C
#if 0
|
|
/*─────────────────────────────────────────────────────────────────╗
|
|
│ To the extent possible under law, Justine Tunney has waived │
|
|
│ all copyright and related or neighboring rights to this file, │
|
|
│ as it is written in the following disclaimers: │
|
|
│ • http://unlicense.org/ │
|
|
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
|
|
╚─────────────────────────────────────────────────────────────────*/
|
|
#endif
|
|
#include "libc/thread/thread.h"
|
|
#include "libc/stdio/stdio.h"
|
|
|
|
/**
|
|
* @fileoverview Basic POSIX Threads Example.
|
|
*
|
|
* $ make -j8 o//examples/thread.com
|
|
* $ o//examples/thread.com
|
|
* hi there
|
|
*
|
|
*/
|
|
|
|
void *worker(void *arg) {
|
|
fputs(arg, stdout);
|
|
return "there\n";
|
|
}
|
|
|
|
int main() {
|
|
void *result;
|
|
pthread_t id;
|
|
pthread_create(&id, 0, worker, "hi ");
|
|
pthread_join(id, &result);
|
|
fputs(result, stdout);
|
|
}
|