MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / dequeue

Method dequeue

tests/relacy/relacy/test/main.cpp:72–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 void* dequeue()
73 {
74 node_t* n = 0;
75
76 pthread_mutex_lock(&mtx);
77 while (VAR(head) == 0)
78 pthread_cond_wait(&cv, &mtx);
79 n = VAR(head);
80 if (n->VAR(next) == 0)
81 VAR(tail) = 0;
82 VAR(head) = n->VAR(next);
83 pthread_mutex_unlock(&mtx);
84
85 void* data = n->VAR(data);
86 delete n;
87 return data;
88 }
89
90private:
91 struct node_t

Callers 1

dequeue_threadFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected