diff options
author | George Hazan <george.hazan@gmail.com> | 2015-11-11 15:06:35 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-11-11 15:06:35 +0000 |
commit | 9dbda7a1ea9d0ac91e02bf4e605618203faf83bc (patch) | |
tree | a9bd5e9b1d65664ac00635d8fd2ecd1217df5c85 /include/m_core.h | |
parent | d6990ccddb9d6f432fd0392e241d48f95102cf13 (diff) |
thread library:
- _beginthread replaced with CreateThread();
- functions forkthread & forkthreadex removed;
- macroses mir_forkthread, mir_forkthreadex & mir_forkthreadowner became real functions;
git-svn-id: http://svn.miranda-ng.org/main/trunk@15710 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_core.h')
-rw-r--r-- | include/m_core.h | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/include/m_core.h b/include/m_core.h index 0634c63d7a..a9a900f03c 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -554,32 +554,27 @@ public: ///////////////////////////////////////////////////////////////////////////////
// threads
-typedef void (__cdecl *pThreadFunc)(void*);
-typedef unsigned (__stdcall *pThreadFuncEx)(void*);
-typedef unsigned (__cdecl *pThreadFuncOwner)(void *owner, void* param);
+typedef void (__cdecl *pThreadFunc)(void *param);
+typedef unsigned (__stdcall *pThreadFuncEx)(void *param);
+typedef unsigned (__cdecl *pThreadFuncOwner)(void *owner, void *param);
#if defined( __cplusplus )
- MIR_CORE_DLL(INT_PTR) Thread_Push(HINSTANCE hInst, void* pOwner=NULL);
+ MIR_CORE_DLL(INT_PTR) Thread_Push(HINSTANCE hInst, void* pOwner = NULL);
#else
MIR_CORE_DLL(INT_PTR) Thread_Push(HINSTANCE hInst, void* pOwner);
#endif
MIR_CORE_DLL(INT_PTR) Thread_Pop(void);
MIR_CORE_DLL(void) Thread_Wait(void);
-MIR_CORE_DLL(UINT_PTR) forkthread(pThreadFunc, unsigned long stacksize, void *arg);
-MIR_CORE_DLL(UINT_PTR) forkthreadex(void *sec, unsigned stacksize, pThreadFuncEx, void* owner, void *arg, unsigned *thraddr);
-
-__forceinline HANDLE mir_forkthread(pThreadFunc aFunc, void* arg)
-{ return (HANDLE)forkthread(aFunc, 0, arg);
-}
-
-__forceinline HANDLE mir_forkthreadex(pThreadFuncEx aFunc, void* arg, unsigned* pThreadID)
-{ return (HANDLE)forkthreadex(NULL, 0, aFunc, NULL, arg, pThreadID);
-}
-
-__forceinline HANDLE mir_forkthreadowner(pThreadFuncOwner aFunc, void* owner, void* arg, unsigned* pThreadID)
-{ return (HANDLE)forkthreadex(NULL, 0, (pThreadFuncEx)aFunc, owner, arg, pThreadID);
-}
+#if defined( __cplusplus )
+MIR_CORE_DLL(HANDLE) mir_forkthread(pThreadFunc aFunc, void *arg = NULL);
+MIR_CORE_DLL(HANDLE) mir_forkthreadex(pThreadFuncEx aFunc, void *arg = NULL, unsigned *pThreadID = NULL);
+MIR_CORE_DLL(HANDLE) mir_forkthreadowner(pThreadFuncOwner aFunc, void *owner, void *arg = NULL, unsigned *pThreadID = NULL);
+#else
+MIR_CORE_DLL(HANDLE) mir_forkthread(pThreadFunc aFunc, void *arg);
+MIR_CORE_DLL(HANDLE) mir_forkthreadex(pThreadFuncEx aFunc, void *arg, unsigned *pThreadID);
+MIR_CORE_DLL(HANDLE) mir_forkthreadowner(pThreadFuncOwner aFunc, void *owner, void *arg, unsigned *pThreadID);
+#endif
MIR_CORE_DLL(void) Thread_SetName(const char *szThreadName);
|