Hi,

I read the docs about lockfree::queue::empty() and understang what this way is not safe in multithreaded program.
The question is, how can I verify that the queue is empty?
Will it be correct the following code?

bool empty() {
   T *tmp = 0;
   if ( queue.pop(tmp) ) {
      queue.push(tmp);
      return false;
   }
   return true;
}


Thanks.

--
Regards,
niXman
___________________________________________________
Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows:
http://sourceforge.net/projects/mingwbuilds/
___________________________________________________
Another online IDE: http://liveworkspace.org/