summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Mir_core/modules.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/Mir_core/modules.cpp b/plugins/Mir_core/modules.cpp
index 0818e8916e..8f3a123e7c 100644
--- a/plugins/Mir_core/modules.cpp
+++ b/plugins/Mir_core/modules.cpp
@@ -555,17 +555,16 @@ MIR_CORE_DLL(INT_PTR) CallServiceSync(const char *name, WPARAM wParam, LPARAM lP
// the service is looked up within the main thread, since the time it takes
// for the APC queue to clear the service being called maybe removed.
// even thou it may exists before the call, the critsec can't be locked between calls.
- if (GetCurrentThreadId() != mainThreadId) {
- mir_ptr<TServiceToMainThreadItem> item;
- item->wParam = wParam;
- item->lParam = lParam;
- item->name = name;
- item->hDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- QueueMainThread(CallServiceToMainAPCFunc, &item, item->hDoneEvent);
- return item->result;
- }
+ if (GetCurrentThreadId() == mainThreadId)
+ return CallService(name, wParam, lParam);
- return CallService(name, wParam, lParam);
+ mir_ptr<TServiceToMainThreadItem> item;
+ item->wParam = wParam;
+ item->lParam = lParam;
+ item->name = name;
+ item->hDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ QueueMainThread(CallServiceToMainAPCFunc, item, item->hDoneEvent);
+ return item->result;
}
MIR_CORE_DLL(int) CallFunctionAsync(void (__stdcall *func)(void *), void *arg)