1 parent 9fc9acb commit 14583c5Copy full SHA for 14583c5
1 file changed
c_src/nif_helpers.c
@@ -185,10 +185,14 @@ void nif_destroy_main_thread(void* void_st)
185
nif_thread_message* msg = nif_thread_message_alloc(NULL, NULL, NULL);
186
187
nif_thread_send(st, msg);
188
- enif_thread_join(st->tid, NULL);
+ #if defined(__APPLE__) && defined(__MACH__)
189
+ erl_drv_stolen_main_thread_join(st->tid, NULL);
190
+ #else
191
+ enif_thread_join(st->tid, NULL);
192
+ #endif
193
- enif_cond_destroy(st->cond);
194
enif_mutex_destroy(st->lock);
195
+ enif_cond_destroy(st->cond);
196
enif_free(st->mailbox);
197
enif_free(st);
198
}
0 commit comments