From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2007-04-20 17:46:50
Sohail Somani wrote:
>> Steven Watanabe wrote:
>>> It's not thread safe and the only way I can
>>> see to make it so is to have a fixed set
>>> of functions and allocate/deallocate
>> Why would it need to be thread safe? Usually one puts thread safety
>> above this kind of utility layer.
> Well if you need to implement a C-callback that doesn't have a void *
> data argument.
You put the thread safety in what the c-function calls. Now if the
question really is that the setting of the function object instance
isn't thread safe... You would make the code that calls make_c_function
thread safe, by using locks for example. Note, calling the c-function,
and hence the function object, is thread safe AFAIK.
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk