MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / MutIsMainThread

Function MutIsMainThread

oneflow/core/thread/thread_manager.h:81–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81inline bool* MutIsMainThread() {
82 thread_local bool is_main_thread = false;
83 return &is_main_thread;
84}
85
86inline bool IsMainThread() { return *MutIsMainThread(); }
87inline void SetIsMainThread(bool is_main_thread) { *MutIsMainThread() = is_main_thread; }

Callers 2

IsMainThreadFunction · 0.85
SetIsMainThreadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected