summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2016-08-11 21:50:46 +0200
committerEven Rouault <even.rouault@spatialys.com>2016-08-11 21:59:28 +0200
commit4f9abb9a45ffd711f9717db15d062fa020ed6cf5 (patch)
tree78549f93c8a9ec7f620ff0023ea8dd046278b240 /src/lib
parent7d3c7a345f05adbc9ca26d8ca7f6c7fffa5096be (diff)
[Win32] Use _beginthreadex instead of CreateThread()
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/openjp2/thread.c b/src/lib/openjp2/thread.c
index b2f8b5b2..59b5d87e 100644
--- a/src/lib/openjp2/thread.c
+++ b/src/lib/openjp2/thread.c
@@ -44,6 +44,7 @@
#endif
#include <windows.h>
+#include <process.h>
OPJ_BOOL OPJ_CALLCONV opj_has_thread_support(void)
{
@@ -224,11 +225,11 @@ struct opj_thread_t
HANDLE hThread;
};
-static DWORD WINAPI opj_thread_callback_adapter( void *info )
+unsigned int __stdcall opj_thread_callback_adapter( void *info )
{
opj_thread_t* thread = (opj_thread_t*) info;
HANDLE hEvent = NULL;
-
+
thread->thread_fn( thread->user_data );
/* Free the handle possible allocated by a cond */
@@ -258,7 +259,6 @@ static DWORD WINAPI opj_thread_callback_adapter( void *info )
opj_thread_t* opj_thread_create( opj_thread_fn thread_fn, void* user_data )
{
opj_thread_t* thread;
- DWORD nThreadId = 0;
assert( thread_fn );
@@ -268,8 +268,8 @@ opj_thread_t* opj_thread_create( opj_thread_fn thread_fn, void* user_data )
thread->thread_fn = thread_fn;
thread->user_data = user_data;
- thread->hThread = CreateThread( NULL, 0, opj_thread_callback_adapter, thread,
- 0, &nThreadId );
+ thread->hThread = (HANDLE)_beginthreadex(NULL, 0,
+ opj_thread_callback_adapter, thread, 0, NULL);
if( thread->hThread == NULL )
{