diff options
author | elfmz <fenix1905@tut.by> | 2022-01-01 18:13:40 +0300 |
---|---|---|
committer | elfmz <fenix1905@tut.by> | 2022-01-01 18:13:40 +0300 |
commit | d9571de5ac8a60f5ca21e9f7ea1d0417a0405236 (patch) | |
tree | 14757a0f9e7f6f8874b4119460505d0755cff7b6 /far2l/src/base | |
parent | be3e39d471034827e156370b465183248558b668 (diff) |
cosmetic
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 |