On Sat, May 12, 2012 at 12:21 PM, Nikhil Marathe <[email protected]> wrote:
> I am working on a binding to a C++ library. A certain piece of code
> can be called either from the main node/v8 thread,
> or in a worker thread (from uv_queue_work), depending on which JS
> method is invoked by the user of the binding.
> How do I figure out in the C++ code whether the code is running in the
> main node/v8 thread or in the worker thread,
> because this will decide whether I need to use a mutex or not

What is the mutex protecting? If it's a global or shared data
structure, you need to lock the mutex in the main thread as well.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" 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/nodejs?hl=en?hl=en

Reply via email to