klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit dcbeb8363195652755feb65743705470ce9c9bc6
parent e5d2c04761eb5ceeab645971d55e26efd8f8c0e0
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Wed, 22 Aug 2012 02:46:06 -0300

On error throwing, the GIL is released.  This allows code to acquire the GIL any number of times and then call functions that may throw errors before releasing the GIL.

Diffstat:
Msrc/kerror.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/kerror.c b/src/kerror.c @@ -86,6 +86,7 @@ void klispE_throw_simple(klisp_State *K, char *msg) /* clear buffer shouldn't cause GC, but just in case... */ krooted_tvs_push(K, error_obj); clear_buffers(K); /* this pops both error_msg & error_obj */ + klisp_unlock_all(K); /* is this thread holds the GIL release it */ /* call_cont protects error from gc */ kcall_cont(K, G(K)->error_cont, error_obj); } @@ -111,6 +112,7 @@ void klispE_throw_with_irritants(klisp_State *K, char *msg, TValue irritants) /* clear buffer shouldn't cause GC, but just in case... */ krooted_tvs_push(K, error_obj); clear_buffers(K); /* this pops both error_msg & error_obj */ + klisp_unlock_all(K); /* is this thread holds the GIL release it */ /* call_cont protects error from gc */ kcall_cont(K, G(K)->error_cont, error_obj); } @@ -122,6 +124,7 @@ void klispE_throw_system_error_with_irritants( irritants); krooted_tvs_push(K, error_obj); clear_buffers(K); + klisp_unlock_all(K); /* is this thread holds the GIL release it */ kcall_cont(K, G(K)->system_error_cont, error_obj); }