Subj : Re: JS_THREADSAFE required for clients of threadsafe js32.dll? To : netscape.public.mozilla.jseng From : Jens Thiele Date : Wed Nov 10 2004 05:53 pm Digital Man schrieb: > I just noticed that JS_Get/Set/ClearContextThread aren't prototyped in jsapi.h > unless JS_THREADSAFE is defined. > > Now, I've known for a long time that JS_THREADSAFE must be defined when > building a thread-safe JS library (DLL or SO), but I've never defined this > macro when building the applications (clients of the JS library). > > Must JS_THREADSAFE be defined for applications that #include jsapi.h and use a > thread-safe JS library? yes if the library was compiled with JS_THREADSAFE you must compile your apps with JS_THREADSAFE, too. The opposite is also true. The really bad thing: JS_GetClass takes either one or two arguments (depending on JS_THREADSAFE) => the API entry point differs => you can get really ugly crashs/stack corruption (if you got JS_THREADSAFE wrong) I have been caught by this at least twice, too. Jens .