source/lib/dng_sdk/dng_pthread.cpp
// This trampoline takes care of the return type being different
// between pthreads thread funcs and Windows C lib thread funcs

This trampoline takes care of the return type being different
between pthreads thread funcs and Windows C lib thread funcs
This trampoline takes care of the return type being different between pthreads thread funcs and Windows C lib thread funcs
unsigned __stdcall trampoline(void *arg_arg)
	{
		trampoline_args *args_ptr = (trampoline_args *)arg_arg;
		trampoline_args args = *args_ptr;
		delete args_ptr;
		GetThreadSemaphore();
		void *result = args.func(args.arg);
		{
			ScopedLock lockMap(primaryHandleMapLock);
			ThreadMapType::iterator iter = primaryHandleMap.find(pthread_self());
			if (iter != primaryHandleMap.end())
				*iter->second.second = result;
		}
		FreeThreadSemaphore();
		return S_OK;
	}
unsigned __stdcall trampoline ( void * arg_arg ) { trampoline_args * args_ptr = ( trampoline_args * ) arg_arg ; trampoline_args args = * args_ptr ; delete args_ptr ; GetThreadSemaphore ( ) ; void * result = args . func ( args . arg ) ; { ScopedLock lockMap ( primaryHandleMapLock ) ; ThreadMapType :: iterator iter = primaryHandleMap . find ( pthread_self ( ) ) ; if ( iter != primaryHandleMap . end ( ) ) * iter -> second . second = result ; } FreeThreadSemaphore ( ) ; return S_OK ; }
This trampoline takes care of the return type being different
between pthreads thread funcs and Windows C lib thread funcs
This trampoline takes care of the return type being different between pthreads thread funcs and Windows C lib thread funcs