06 2012 档案

linux 多线程(一)条件变量
摘要:#include <stdlib.h> #include <stdio.h> #include <pthread.h> #include <errno.h> int gnum = 0; int gsub = 100;pthread_mutex_t mutex; pthread_cond_t cond; //条件变量 void pthread_func_1 (void); void pthread_func_2 (void); int main (void) { pthread_t pt_1 = 0; pthread_t pt_2 = 0; int 阅读全文

posted @ 2012-06-26 18:21 龙沙宝石 阅读(227) 评论(0) 推荐(0)

c++线程(一)CreateEvent;CreateMutex()
摘要:#include <stdio.h>#include <string> // for STL string class#include <windows.h> // for HANDLE#include <process.h> // for _beginthread()#include <iostream>using namespace std;HANDLE g_event; HANDLE ghMutex; DWORD dwWaitResult01;class ThreadX{private: int loopStart; int l 阅读全文

posted @ 2012-06-12 20:55 龙沙宝石 阅读(2163) 评论(0) 推荐(0)

导航