diff --git a/plugins/mozjs.c b/plugins/mozjs.c index f96bc94..6294c57 100644 --- a/plugins/mozjs.c +++ b/plugins/mozjs.c @@ -41,7 +41,7 @@ #include "pacrunner.h" #include "js.h" -static GStaticMutex mozjs_mutex = G_STATIC_MUTEX_INIT; +static GMutex mozjs_mutex; static struct pacrunner_proxy *current_proxy = NULL; @@ -221,7 +221,7 @@ static char * mozjs_execute(const char *url, const char *host) if (jsctx == NULL) return NULL; - g_static_mutex_lock(&mozjs_mutex); + g_mutex_lock(&mozjs_mutex); JS_BeginRequest(jsctx); @@ -235,7 +235,7 @@ static char * mozjs_execute(const char *url, const char *host) JS_MaybeGC(jsctx); - g_static_mutex_unlock(&mozjs_mutex); + g_mutex_unlock(&mozjs_mutex); if (result) { answer = JS_EncodeString(jsctx, JS_ValueToString(jsctx, rval));