| 46 | |
| 47 | template <class T> |
| 48 | void SimpleQueue<T>::Enqueue(T entry) |
| 49 | { |
| 50 | //Allocate Next entry, and assign to head |
| 51 | SimpleQueueEntry* newHead = new SimpleQueueEntry(); |
| 52 | SimpleQueueEntry* newEntry = head.exchange(newHead); |
| 53 | |
| 54 | //Fill in |
| 55 | newEntry->value = std::move(entry); |
| 56 | newEntry->next = newHead; |
| 57 | |
| 58 | //Set ready (can be dequeued) |
| 59 | newEntry->ready.store(true); |
| 60 | } |
| 61 | |
| 62 | template <class T> |
| 63 | bool SimpleQueue<T>::Dequeue(T* entry) |
no outgoing calls
no test coverage detected