| 104 | |
| 105 | private: |
| 106 | struct Data |
| 107 | { |
| 108 | Data() = default; |
| 109 | |
| 110 | ~Data() |
| 111 | { |
| 112 | // TODO(benh): Fail promises? |
| 113 | } |
| 114 | |
| 115 | // Rather than use a process to serialize access to the queue's |
| 116 | // internal data we use a 'std::atomic_flag'. |
| 117 | std::atomic_flag lock = ATOMIC_FLAG_INIT; |
| 118 | |
| 119 | // Represents "waiters" for elements from the queue. |
| 120 | std::deque<Owned<Promise<T>>> promises; |
| 121 | |
| 122 | // Represents elements already put in the queue. |
| 123 | std::queue<T> elements; |
| 124 | }; |
| 125 | |
| 126 | std::shared_ptr<Data> data; |
| 127 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected