inlib
1.2.0
|
00001 // Copyright (C) 2010, Guy Barrand. All rights reserved. 00002 // See the file inlib.license for terms. 00003 00004 #ifndef inlib_sys_thread 00005 #define inlib_sys_thread 00006 00007 #ifdef WIN32 00008 00009 #include <windows.h> 00010 00011 class pthread_t { 00012 public: 00013 inline pthread_t():m_id(0),m_handle(0){} 00014 public: 00015 DWORD m_id; 00016 HANDLE m_handle; 00017 }; 00018 00019 inline void pthread_create(pthread_t* a_thread,void*,void*(*a_func)(void*),void* a_tag){ 00020 a_thread->m_handle = ::CreateThread(0,0, 00021 (LPTHREAD_START_ROUTINE)a_func,a_tag,0,(DWORD*)&(a_thread->m_id)); 00022 } 00023 00024 #else 00025 00026 #include <pthread.h> 00027 00028 #endif 00029 00030 #endif