| 110 | } |
| 111 | |
| 112 | void set_exception(std::exception_ptr e) { |
| 113 | if (e) { |
| 114 | MGB_LOCK_GUARD(m_lock); |
| 115 | if (m_read_ahead >= 0) { |
| 116 | mgb_assert(m_read_ahead <= 1); |
| 117 | if (m_drop_next) { |
| 118 | m_drop_next = false; |
| 119 | } else { |
| 120 | m_promise.set_exception(e); |
| 121 | } |
| 122 | if (m_read_ahead == 1) { |
| 123 | m_promise = {}; |
| 124 | } |
| 125 | --m_read_ahead; |
| 126 | } else { |
| 127 | mgb_assert(m_read_ahead == -1); |
| 128 | // TODO: maybe exception should be ignored |
| 129 | // if value was already set ? |
| 130 | m_promise.set_exception(e); |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | }; |
| 135 | |
| 136 | void init_graph_rt(pybind11::module m); |
no outgoing calls
no test coverage detected