/*****************************************************************************
* win32thread.c: windows threading
*****************************************************************************
- * Copyright (C) 2010-2012 x264 project
+ * Copyright (C) 2010-2013 x264 project
*
* Authors: Steven Walters <kemuri9@gmail.com>
* Pegasys Inc. <http://www.pegasys-inc.com>
static unsigned __stdcall x264_win32thread_worker( void *arg )
{
x264_pthread_t *h = arg;
- h->ret = h->func( h->arg );
+ *h->p_ret = h->func( h->arg );
return 0;
}
{
thread->func = start_routine;
thread->arg = arg;
+ thread->p_ret = &thread->ret;
+ thread->ret = NULL;
thread->handle = (void*)_beginthreadex( NULL, 0, x264_win32thread_worker, thread, 0, NULL );
return !thread->handle;
}
if( ret != WAIT_OBJECT_0 )
return -1;
if( value_ptr )
- *value_ptr = thread.ret;
+ *value_ptr = *thread.p_ret;
CloseHandle( thread.handle );
return 0;
}
memset( &thread_control, 0, sizeof(x264_win32thread_control_t) );
}
-int x264_pthread_num_processors_np()
+int x264_pthread_num_processors_np( void )
{
DWORD_PTR system_cpus, process_cpus = 0;
int cpus = 0;