mirror of
https://github.com/janet-lang/janet
synced 2025-11-21 01:34:49 +00:00
Keep single global pthread_cond_t per thread.
This will allow thread/select to be implemented. Also add thread/close and close method to threads.
This commit is contained in:
@@ -1250,6 +1250,10 @@ int janet_init(void) {
|
||||
janet_vm_core_env = NULL;
|
||||
/* Seed RNG */
|
||||
janet_rng_seed(janet_default_rng(), 0);
|
||||
/* Threads */
|
||||
#ifdef JANET_THREADS
|
||||
janet_threads_init();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1263,4 +1267,7 @@ void janet_deinit(void) {
|
||||
janet_vm_root_capacity = 0;
|
||||
janet_vm_registry = NULL;
|
||||
janet_vm_core_env = NULL;
|
||||
#ifdef JANET_THREADS
|
||||
janet_threads_deinit();
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user