Subj : Re: JS_HandleTrap unhandled exception To : netscape.public.mozilla.jseng From : Mike Moening Date : Thu Mar 31 2005 10:58 pm I get your point. That explains some lingering weirdness I've been seeing. I have no problem putting criticial sections around my trap set/clear code but how do I prevent myself from stomping on the internal spidermonkey trapList from another thread. In other words, can I "lock" the internal trap list temporarily? I know it may delay execution but only for millisecond. "Brendan Eich" wrote in message news:d2ih4j$nkq2@ripley.netscape.com... > Mike Moening wrote: > > I figured out the problem. > > > > Confutious say: > > It is better to use JS_ClearTrap than to use JS_SetTrap to clear a trap... > > > > Doh! > > Also, did you say "other thread"? The JS debugger API is designed to be > called from a single-threaded debugger, or a one-thread at a time > debugger, or a debugger that is carefully multi-threaded with its own > locking layer above the jsdbgapi.c code, which you'll notice does not > lock critical sections, e.g. for rt->trapList access and update. > > /be .