MCPcopy Create free account
hub / github.com/SNAS/openbmp / push

Method push

Server/src/safeQueue.hpp:55–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 }
54
55 void push(type const &elem) {
56 // Lock
57 pthread_mutex_lock (&mutex);
58
59 /*
60 * Wait/block if limit has been reached
61 */
62 if (limit and size() >= limit) {
63 pthread_mutex_unlock (&mutex);
64
65 while (size() >= limit) {
66 usleep(10000);
67 }
68
69 pthread_mutex_lock (&mutex);
70 }
71
72 // Add
73 queue<type>::push(elem);
74
75 // Unlock
76 pthread_mutex_unlock (&mutex);
77 }
78
79 void pop() {
80

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected