#include #include #include #include static int rand_invocator_thread (void *arg) { printf ("Value from separate thread: %d\n", rand ()); return 0; } int main () { unsigned int seed = 19891109; srand (seed); printf ("Value from main thread: %d\n", rand ()); srand (seed); thrd_t t; assert (thrd_create (&t, rand_invocator_thread, NULL) == thrd_success); assert (thrd_join (t, NULL) == thrd_success); return 0; }