
10 Jun
2006
10 Jun
'06
1:51 a.m.
Hello! I am using a library which itself internally does not use any thread sync mechanisms but it provides callback functions lib_lock() and lib_unlock() which I can specify if the lib is used in multithread environment. lib_lock() would get called before critical segment and after it lib_unlock() would get called. I read Boost.Thread documentation and I understand that lock concept is not thread-safe itself and should be used only at block scope. This makes me think that I have no way to use locking provided by Boost to acquire a lock in lib_lock() function and release it in lib_unlock()? But I am not sure. Do you have any suggestions if this can be done using Boost? Thanks! P.Krumins