No, it is thread safe because each thread has its own stack and where retobj.
, , - . RAII . - ...
class CriticalLock : boost::noncopyable {
CriticalSection §ion;
public:
CriticalLock(CriticalSection &cs) : section(cs)
{
EnterCriticalSection(section);
}
~CriticalLock()
{
LeaveCriticalSection(section);
}
};
:
myNode getSomeData( )
{
CriticalLock lock(myCritSec);
...
}