* front * Thread safe method that returns a copy of the front object * in the arg passed as value. * * ARGS: * value = Reference to allocated . * * RETURNS: * true if the value was updated, false if not */
| 106 | * true if the value was updated, false if not |
| 107 | */ |
| 108 | bool front(type &value) { |
| 109 | bool rval = true; |
| 110 | |
| 111 | // Lock |
| 112 | pthread_mutex_lock (&mutex); |
| 113 | |
| 114 | // Before getting element, check if there are any |
| 115 | if (queue<type>::size() > 0) { |
| 116 | |
| 117 | // get front |
| 118 | value = queue<type>::front(); |
| 119 | |
| 120 | } else |
| 121 | rval = false; |
| 122 | |
| 123 | // Unlock |
| 124 | pthread_mutex_unlock (&mutex); |
| 125 | |
| 126 | return rval; |
| 127 | } |
| 128 | |
| 129 | |
| 130 | /** |
no outgoing calls
no test coverage detected