std::queue empty() is thread safe?
hi,
just want to know if std::queue empty() is thread safe (running on 2 or more
thread)... so i can do,
if( !queue.empty() )
{
lock()
....
unlock()
}
instead of...
lock()
if( !queue.empty() )
{
....
}
unlock()
thanks in advance
.
Relevant Pages
- Re: Refresh Problem
... If I wait 3 seconds between mouse clicks on the lock / unlock button, ... workstation is looking at a current copy of the data. ... MESSAGEBOX statement after all of the database lookups have been done ... (microsoft.public.fox.programmer.exchange) - Re: A scoped lock/unlock implementation in C++.
... mutex_locker wrapping the same mutex, more than one thread won't share ... But beyond that it will still work with thread local mutex_locker instances, since no two threads can have a nonzero lock count anyway. ... When entering a locked region, if the last entry is negative, you know ... In case of unlocks even the unlock count is insignificant. ... (comp.programming.threads) - Re: [PATCH] Remove softlockup from invalidate_mapping_pages.
... These block devices are very likely to have just one ... Being locked for read is very unlikely because mdadm would have already ... memory reclaim could lock the page, ... core is free to unlock the page when the IO completes, ... (Linux-Kernel) - Re: Why are Boost thread mutexes so slow compared to Pthreads?
... Don't let unlock() happen automatically for unexpected throws ... ENOTRECOVERABLE returned on subsequent lock()) to expose corruption. ... A thrown exception may not be a fatal error per se, ... There's no reason why this function ... (comp.programming.threads) - Re: Behavior of flock() oriented procedures
... happens when a file descriptor is locked. ... descriptore without explicitly calling flockwith the unlock message, ... does this mean that the file will still have the lock on it, ... without any explicit unlocking. ... (comp.unix.programmer) |
|