MCPcopy Create free account
hub / github.com/BirolLab/abyss / pop

Method pop

KAligner/Pipe.h:40–59  ·  view source on GitHub ↗

Get data and remove it from the buffer. */

Source from the content-addressed store, hash-verified

38
39 /** Get data and remove it from the buffer. */
40 std::pair<T, size_t> pop()
41 {
42 // block when pipe is empty and m_open, or in use.
43 m_sem_out.wait();
44 pthread_mutex_lock(&m_mutex_queue);
45
46 std::pair<T, size_t> temp = remove();
47
48 pthread_mutex_unlock(&m_mutex_queue);
49
50 // If pipe is m_open ensure poping will allow one more push.
51 // Otherwise, let next accessor know pipe is closed.
52 if (temp.second)
53 m_sem_in.post();
54 else {
55 assert(!m_open);
56 m_sem_out.post();
57 }
58 return temp;
59 }
60
61 /** Allows a pop when the pipe is empty to signal the pipe is
62 * closed. */

Callers 7

getTreeTracesFunction · 0.80
breadthFirstSearchImplFunction · 0.80
bidirectionalBFSFunction · 0.80
findFunction · 0.80
printAlignmentsFunction · 0.80
nextValueMethod · 0.80
removeMethod · 0.80

Calls 2

waitMethod · 0.80
postMethod · 0.80

Tested by

no test coverage detected