• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            jake1036

            larbin源碼分析(六) larbin中線程處理類

            larbin源碼分析(六) larbin中線程處理類

             一 線程類
                 larbin下的線程操作類,主要在mypthread.h 中定義,實質上是利用宏定義,封裝了 pthread.h中的系統調用。
                 一個進程可以有多個線程,每個線程都有自己的處理流程。 
              二 具體實現
                 typedef void* (*StartFun) (void *);
                void startThread (StartFun run, void *arg);
               startThread 函數實質上是 調用pthread_create 啟動一個新的線程。

            //下面為線程同步的操作
            #define mypthread_cond_init(x,y) pthread_cond_init(x,y)
            #define mypthread_cond_destroy(x) pthread_cond_destroy(x)
            #define mypthread_cond_wait(c,x,y) while (c) { pthread_cond_wait(x,y); }
            #define mypthread_cond_broadcast(x) pthread_cond_broadcast(x)

             //下面為線程互斥的操作
            #define mypthread_mutex_init(x,y) pthread_mutex_init(x,y)
            #define mypthread_mutex_destroy(x) pthread_mutex_destroy(x)
            #define mypthread_mutex_lock(x) pthread_mutex_lock(x)
            #define mypthread_mutex_unlock(x) pthread_mutex_unlock(x)


                 

            posted on 2011-06-13 17:23 kahn 閱讀(766) 評論(0)  編輯 收藏 引用 所屬分類: larbin源碼分析

            久久精品亚洲福利| 久久青青草原精品影院| 久久久久亚洲精品中文字幕| 欧美日韩精品久久久久| 国产精品中文久久久久久久| 久久人人爽人人人人爽AV| 久久久久亚洲AV无码专区体验| 国产综合久久久久久鬼色| 久久精品国产第一区二区| 99久久精品免费看国产一区二区三区| 久久综合久久自在自线精品自 | 一本久久a久久精品综合香蕉| 国产精品99久久久精品无码| 91精品国产91热久久久久福利| 色欲综合久久躁天天躁| AV色综合久久天堂AV色综合在 | 国产成人久久精品麻豆一区| 久久国产亚洲精品| 26uuu久久五月天| 久久精品夜夜夜夜夜久久| 久久久久一级精品亚洲国产成人综合AV区| 亚洲午夜久久久久久噜噜噜| 色婷婷狠狠久久综合五月| 婷婷久久综合九色综合98| 久久久久亚洲精品日久生情| 久久精品成人免费观看97| 久久精品国产99国产精品澳门 | 99久久成人18免费网站| 亚洲精品无码久久一线| 久久久艹| 久久国产成人| 很黄很污的网站久久mimi色| 亚洲女久久久噜噜噜熟女| 一本久久综合亚洲鲁鲁五月天| 久久www免费人成看国产片| 狠狠久久亚洲欧美专区| 青草影院天堂男人久久| 久久综合中文字幕| 精品国产青草久久久久福利| 狠狠狠色丁香婷婷综合久久五月| 国产美女久久精品香蕉69|