Skip to content
Snippets Groups Projects
Commit 0e68118f authored by amichelotti's avatar amichelotti
Browse files

queue clear

parent 90c81462
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,16 @@ class TLockFreeQueue {
}
return ret;
}
int clear(){
T* ele=NULL;
while(element_queue.pop(ele)){
if(ele){
delete ele;
}
size--;
}
return size;
}
int wait_and_pop(T& popped_value, int timeout_ms = 0) {
if (element_queue.empty()) {
ChaosUniqueLock lock(the_mutex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment