From c9fc486119260aca206c2a5d336cf31496e9f511 Mon Sep 17 00:00:00 2001 From: Djomanix Date: Mon, 23 Jun 2014 14:28:09 -0400 Subject: [PATCH] Added 'create_thread' function to enable thread creation after a exit. Signed-off-by: Djomanix --- lib/pnacl.nit | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pnacl.nit b/lib/pnacl.nit index fde40f3..994bbdb 100644 --- a/lib/pnacl.nit +++ b/lib/pnacl.nit @@ -725,7 +725,12 @@ class PnaclApp end redef interface Object - # Calls 'pthread_exit on current thread + # Creates a new thread for Nit. + fun create_thread `{ + pthread_create(&g_nit_thread, NULL, &WrapperNitMain, NULL); + `} + + # Calls 'pthread_exit on current thread. fun exit_thread(exit_value: Int) `{ pthread_exit((void*) exit_value); `} -- 1.7.9.5