Linux 和 Windows多线程函数对应表

Linux Pthread API                               Windows SDK 库对应 API

创建  pthread_create                              CreateThread
退出  pthread_exit                                ThreadExit
等待  pthread_join                                WaitForSingleObject

互斥锁:    
创建  pthread_mutex_init                          CreateMutex
销毁  pthread_mutex_destroy                       CloseHandle
加锁  pthread_mutex_lock                          WaitForSingleObject
解锁  pthread_mutex_unlock                        ReleaseMutex

条件:
创建  pthread_cond_init                           CreateEvent
销毁  pthread_cond_destroy                        CloseHandle
触发  pthread_cond_signal                         SetEvent
广播  pthread_cond_broadcast                      SetEvent/ResetEvent
等待  pthread_cond_wait/pthread_cond_timedwait    SingleObjectAndWait
posted @ 2015-06-24 18:04  thomas_blog  阅读(214)  评论(0编辑  收藏  举报