Mercurial > pymonkey
changeset 69:c2972e58fbb6
Made the conversion of JS exceptions into strings release the GIL.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 26 Jul 2009 16:44:12 -0700 |
parents | 19f3bc257a25 |
children | b0360c0ed546 |
files | utils.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/utils.c Sun Jul 26 16:24:32 2009 -0700 +++ b/utils.c Sun Jul 26 16:44:12 2009 -0700 @@ -205,7 +205,12 @@ jsval val; if (JS_GetPendingException(context->cx, &val)) { - JSString *str = JS_ValueToString(context->cx, val); + JSString *str = NULL; + + Py_BEGIN_ALLOW_THREADS; + str = JS_ValueToString(context->cx, val); + Py_END_ALLOW_THREADS; + if (str != NULL) { // TODO: Wrap the original JS exception so that the client can // examine it.