On 11/8/2009 6:58 AM, Kodak wrote:
> Hi all, I need to synch couple of tabs not to do same thing at the
> same time so I need a semaphore. Is there a way to do a safe check and
> change value in GM?

Javascript in Firefox is single-threaded, so you don't need to worry 
about other scripts running, unless you specifically stop execution and 
continue later (via an ajax call, a setTimeout, event handler, etc).

So, if you I.E. get a value (let's say a lock) that is false, 
immediately set it true and _then_ start doing your work (which can 
include the "stopping" methods mentioned above), no other script is 
going to execute between your get and set.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to