diff options
Diffstat (limited to 'far2l/src/base')
-rw-r--r-- | far2l/src/base/InterThreadCall.cpp | 4 | ||||
-rw-r--r-- | far2l/src/base/InterThreadCall.hpp | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/far2l/src/base/InterThreadCall.cpp b/far2l/src/base/InterThreadCall.cpp index 4207144f..e29962a4 100644 --- a/far2l/src/base/InterThreadCall.cpp +++ b/far2l/src/base/InterThreadCall.cpp @@ -51,14 +51,14 @@ void OverrideInterThreadID(unsigned int tid) g_thread_id = tid; } -void StartDispatchingInterThreadCalls() +InterThreadCallsDispatcherThread::InterThreadCallsDispatcherThread() { const DWORD self_tid = GetInterThreadID(); std::lock_guard<std::mutex> lock(s_inter_thread_call_synch.mtx); s_interlocked_delegates_tid = self_tid; } -void StopDispatchingInterThreadCalls() +InterThreadCallsDispatcherThread::~InterThreadCallsDispatcherThread() { assert((IsCurrentThreadDispatchesInterThreadCalls())); InterThreadCallDelegates interlocked_delegates; diff --git a/far2l/src/base/InterThreadCall.hpp b/far2l/src/base/InterThreadCall.hpp index aebd538f..e5ea25be 100644 --- a/far2l/src/base/InterThreadCall.hpp +++ b/far2l/src/base/InterThreadCall.hpp @@ -17,8 +17,12 @@ unsigned int GetInterThreadID(); // to be possible run exclusively - either one, either another void OverrideInterThreadID(unsigned int tid); -void StartDispatchingInterThreadCalls(); -void StopDispatchingInterThreadCalls(); +struct InterThreadCallsDispatcherThread +{ + InterThreadCallsDispatcherThread(); + ~InterThreadCallsDispatcherThread(); +}; + bool IsCurrentThreadDispatchesInterThreadCalls(); int DispatchInterThreadCalls(); @@ -122,6 +126,7 @@ template <class FN> c->Enqueue(); } +////////////////////////////////////////////////// struct InterThreadLock |