MCPcopy Create free account
hub / github.com/apple/foundationdb / onMainThread

Method onMainThread

flow/Net2.actor.cpp:1817–1830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1815}
1816
1817void 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
1832THREAD_HANDLE Net2::startThread(THREAD_FUNC_RETURN (*func)(void*), void* arg, int stackSize, const char* name) {
1833 return ::startThread(func, arg, stackSize, name);

Callers 10

Net2.actor.cppFile · 0.45
onMainThreadVoidFunction · 0.45
fireMethod · 0.45
errorMethod · 0.45
onMainThreadFunction · 0.45
sendMethod · 0.45
sendErrorMethod · 0.45
sendMethod · 0.45
sendErrorMethod · 0.45
backToFutureCallbackFunction · 0.45

Calls 4

moveFunction · 0.85
OrderedTaskClass · 0.85
wakeMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected