summaryrefslogtreecommitdiff
path: root/plugins/Mir_core/modules.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-29 12:26:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-29 12:26:34 +0000
commitd80ee102fba0f99ad2ab0e0e734267f76b3b639e (patch)
tree743e8e8d7c4878eecbba5f29af742dfc78fc6358 /plugins/Mir_core/modules.cpp
parent0be097c1e20d55dd2807f9b6f252e6a7cfe40fd1 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@685 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Mir_core/modules.cpp')
-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)