Subj : JS_EvaluateScript on simple thread To : netscape.public.mozilla.jseng From : ismy_br Date : Thu Sep 16 2004 06:01 pm Hi Everyone! - Using mozilla 1.4.1 sources. I´m getting some problems using an unique thread with SpiderMonkey. Mozilla crashes on - jslock.c:985 - JS_ASSERT(me == CurrentThreadId());. I dont mean... how can I use a global context? I´ve read many problems about multi-thread. But I tried tried everything. This is my short code: ========================================== JSContext *cx_glob; JSObject *obj_glob; int thread_display() { while(foo) { if(bar) { JS_BeginRequest(cx_glob); JS_EvaluateScript(cx_glob, obj_glob, "script()", 8, "", 0, &rval_thread); JS_EndRequest(cx_glob); } } } /* It´s executed when the page is started*/ static JSBool classname_iniciashare(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { cx_glob = cx; obj_glob = obj; evento_thread = pthread_create(&thdisp, NULL, (void*)&thread_display, NULL); return JS_TRUE; } ========================================== What´s the problem? I´ve tried to create new context too. Using the same runtime (cx_glob->runtime). But the code doesn´t interpret the object property correctly. Regards, Jacknill .