| 1815 | } |
| 1816 | |
| 1817 | void Net2::onMainThread(Promise<Void>&& signal, TaskPriority taskID) { |
| 1818 | if (stopped) |
| 1819 | return; |
| 1820 | PromiseTask* p = new PromiseTask(std::move(signal)); |
| 1821 | int64_t priority = int64_t(taskID) << 32; |
| 1822 | |
| 1823 | if (thread_network == this) { |
| 1824 | processThreadReady(); |
| 1825 | this->ready.push(OrderedTask(priority - (++tasksIssued), taskID, p)); |
| 1826 | } else { |
| 1827 | if (threadReady.push(OrderedTask(priority, taskID, p))) |
| 1828 | reactor.wake(); |
| 1829 | } |
| 1830 | } |
| 1831 | |
| 1832 | THREAD_HANDLE Net2::startThread(THREAD_FUNC_RETURN (*func)(void*), void* arg, int stackSize, const char* name) { |
| 1833 | return ::startThread(func, arg, stackSize, name); |
no test coverage detected