亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? readme.cv

?? pthread source code,you can compile directly
?? CV
?? 第 1 頁 / 共 5 頁
字號:
      /*       * Wait for all the awakened threads to acquire their part of       * the counting semaphore       */      if (WaitForSingleObject (cv->waitersDone, INFINITE)          == WAIT_OBJECT_0)        {          result = 0;        }      else        {          result = EINVAL;        }    }  return (result);}BTW, on my system (2 CPUs) I can manage to getthe program stalled even without any source codemodification if I run the tennisb program manytimes in different shell sessions.===================pthread-win32 patch===================struct pthread_cond_t_ {  long            nWaitersBlocked;   /* Number of threads blocked*/  long            nWaitersUnblocked; /* Number of threads unblocked*/  long            nWaitersToUnblock; /* Number of threads to unblock*/  sem_t           semBlockQueue;     /* Queue up threads waiting for the*/                                     /*   condition to become signalled*/  sem_t           semBlockLock;      /* Semaphore that guards access to*/                                     /* | waiters blocked count/block queue*/                                     /* +-> Mandatory Sync.LEVEL-1*/  pthread_mutex_t mtxUnblockLock;    /* Mutex that guards access to*/                                     /* | waiters (to)unblock(ed) counts*/                                     /* +-> Optional* Sync.LEVEL-2*/};                                   /* Opt*) for _timedwait andcancellation*/intpthread_cond_init (pthread_cond_t * cond, const pthread_condattr_t * attr)  int result = EAGAIN;  pthread_cond_t cv = NULL;  if (cond == NULL)    {(cond      return EINVAL;    }  if ((attr != NULL && *attr != NULL) &&      ((*attr)->pshared == PTHREAD_PROCESS_SHARED))    {      /*       * Creating condition variable that can be shared between       * processes.       */      result = ENOSYS;      goto FAIL0;    }  cv = (pthread_cond_t) calloc (1, sizeof (*cv));  if (cv == NULL)    {(cv      result = ENOMEM;      goto FAIL0;    }  cv->nWaitersBlocked   = 0;  cv->nWaitersUnblocked = 0;  cv->nWaitersToUnblock = 0;  if (sem_init (&(cv->semBlockLock), 0, 1) != 0)    {(sem_init      goto FAIL0;    }  if (sem_init (&(cv->semBlockQueue), 0, 0) != 0)    {(sem_init      goto FAIL1;    }  if (pthread_mutex_init (&(cv->mtxUnblockLock), 0) != 0)    {(pthread_mutex_init      goto FAIL2;    }  result = 0;  goto DONE;  /*   * -------------   * Failed...   * -------------   */FAIL2:  (void) sem_destroy (&(cv->semBlockQueue));FAIL1:  (void) sem_destroy (&(cv->semBlockLock));FAIL0:DONE:  *cond = cv;  return (result);}                               /* pthread_cond_init */intpthread_cond_destroy (pthread_cond_t * cond){  int result = 0;  pthread_cond_t cv;  /*   * Assuming any race condition here is harmless.   */  if (cond == NULL      || *cond == NULL)    {      return EINVAL;    }  if (*cond != (pthread_cond_t) PTW32_OBJECT_AUTO_INIT)    {(*cond      cv = *cond;      /*       * Synchronize access to waiters blocked count (LEVEL-1)       */      if (sem_wait(&(cv->semBlockLock)) != 0)        {(sem_wait(&(cv->semBlockLock))          return errno;        }      /*       * Synchronize access to waiters (to)unblock(ed) counts (LEVEL-2)       */      if ((result = pthread_mutex_lock(&(cv->mtxUnblockLock))) != 0)        {((result          (void) sem_post(&(cv->semBlockLock));          return result;        }      /*       * Check whether cv is still busy (still has waiters blocked)       */      if (cv->nWaitersBlocked - cv->nWaitersUnblocked > 0)        {(cv->nWaitersBlocked          (void) sem_post(&(cv->semBlockLock));          (void) pthread_mutex_unlock(&(cv->mtxUnblockLock));          return EBUSY;        }      /*       * Now it is safe to destroy       */      (void) sem_destroy (&(cv->semBlockLock));      (void) sem_destroy (&(cv->semBlockQueue));      (void) pthread_mutex_unlock (&(cv->mtxUnblockLock));      (void) pthread_mutex_destroy (&(cv->mtxUnblockLock));      free(cv);      *cond = NULL;    }  else    {      /*       * See notes in ptw32_cond_check_need_init() above also.       */      EnterCriticalSection(&ptw32_cond_test_init_lock);      /*       * Check again.       */      if (*cond == (pthread_cond_t) PTW32_OBJECT_AUTO_INIT)        {(*cond          /*           * This is all we need to do to destroy a statically           * initialised cond that has not yet been used (initialised).           * If we get to here, another thread           * waiting to initialise this cond will get an EINVAL.           */          *cond = NULL;        }      else        {          /*           * The cv has been initialised while we were waiting           * so assume it's in use.           */          result = EBUSY;        }      LeaveCriticalSection(&ptw32_cond_test_init_lock);    }  return (result);}/* * Arguments for cond_wait_cleanup, since we can only pass a * single void * to it. */typedef struct {  pthread_mutex_t * mutexPtr;  pthread_cond_t cv;  int * resultPtr;} ptw32_cond_wait_cleanup_args_t;static voidptw32_cond_wait_cleanup(void * args){  ptw32_cond_wait_cleanup_args_t * cleanup_args =(ptw32_cond_wait_cleanup_args_t *) args;  pthread_cond_t cv = cleanup_args->cv;  int * resultPtr = cleanup_args->resultPtr;  int eLastSignal; /* enum: 1=yes 0=no -1=cancelled/timedout w/o signal(s)*/  int result;  /*   * Whether we got here as a result of signal/broadcast or because of   * timeout on wait or thread cancellation we indicate that we are no   * longer waiting. The waiter is responsible for adjusting waiters   * (to)unblock(ed) counts (protected by unblock lock).   * Unblock lock/Sync.LEVEL-2 supports _timedwait and cancellation.   */  if ((result = pthread_mutex_lock(&(cv->mtxUnblockLock))) != 0)    {((result      *resultPtr = result;      return;    }  cv->nWaitersUnblocked++;  eLastSignal = (cv->nWaitersToUnblock == 0) ?                   -1 : (--cv->nWaitersToUnblock == 0);  /*   * No more LEVEL-2 access to waiters (to)unblock(ed) counts needed   */  if ((result = pthread_mutex_unlock(&(cv->mtxUnblockLock))) != 0)    {((result      *resultPtr = result;      return;    }  /*   * If last signal...   */  if (eLastSignal == 1)    {(eLastSignal     /*      * ...it means that we have end of 'atomic' signal/broadcast      */      if (sem_post(&(cv->semBlockLock)) != 0)        {(sem_post(&(cv->semBlockLock))          *resultPtr = errno;          return;        }    }  /*   * If not last signal and not timed out/cancelled wait w/o signal...   */  else if (eLastSignal == 0)    {     /*      * ...it means that next waiter can go through semaphore      */      if (sem_post(&(cv->semBlockQueue)) != 0)        {(sem_post(&(cv->semBlockQueue))          *resultPtr = errno;          return;        }    }  /*   * XSH: Upon successful return, the mutex has been locked and is owned   * by the calling thread   */  if ((result = pthread_mutex_lock(cleanup_args->mutexPtr)) != 0)    {((result      *resultPtr = result;    }}                               /* ptw32_cond_wait_cleanup */static intptw32_cond_timedwait (pthread_cond_t * cond,                      pthread_mutex_t * mutex,                      const struct timespec *abstime){  int result = 0;  pthread_cond_t cv;  ptw32_cond_wait_cleanup_args_t cleanup_args;  if (cond == NULL || *cond == NULL)    {(cond      return EINVAL;    }  /*   * We do a quick check to see if we need to do more work   * to initialise a static condition variable. We check   * again inside the guarded section of ptw32_cond_check_need_init()   * to avoid race conditions.   */  if (*cond == (pthread_cond_t) PTW32_OBJECT_AUTO_INIT)    {(*cond      result = ptw32_cond_check_need_init(cond);    }  if (result != 0 && result != EBUSY)    {(result      return result;    }  cv = *cond;  /*   * Synchronize access to waiters blocked count (LEVEL-1)   */  if (sem_wait(&(cv->semBlockLock)) != 0)    {(sem_wait(&(cv->semBlockLock))      return errno;    }  cv->nWaitersBlocked++;  /*   * Thats it. Counted means waiting, no more access needed   */  if (sem_post(&(cv->semBlockLock)) != 0)    {(sem_post(&(cv->semBlockLock))      return errno;    }  /*   * Setup this waiter cleanup handler   */  cleanup_args.mutexPtr = mutex;  cleanup_args.cv = cv;  cleanup_args.resultPtr = &result;  pthread_cleanup_push (ptw32_cond_wait_cleanup, (void *) &cleanup_args);  /*   * Now we can release 'mutex' and...   */  if ((result = pthread_mutex_unlock (mutex)) == 0)    {((result      /*       * ...wait to be awakened by       *              pthread_cond_signal, or       *              pthread_cond_broadcast, or       *              timeout, or       *              thread cancellation       *       * Note:       *       *      ptw32_sem_timedwait is a cancellation point,       *      hence providing the mechanism for making       *      pthread_cond_wait a cancellation point.       *      We use the cleanup mechanism to ensure we       *      re-lock the mutex and adjust (to)unblock(ed) waiters       *      counts if we are cancelled, timed out or signalled.       */      if (ptw32_sem_timedwait (&(cv->semBlockQueue), abstime) != 0)        {(ptw32_sem_timedwait          result = errno;        }    }  /*   * Always cleanup   */  pthread_cleanup_pop (1);  /*   * "result" can be modified by the cleanup handler.   */  return (result);}                               /* ptw32_cond_timedwait */static intptw32_cond_unblock (pthread_cond_t * cond,                    int unblockAll){  int result;  pthread_cond_t cv;  if (cond == NULL || *cond == NULL)    {(cond      return EINVAL;    }  cv = *cond;  /*   * No-op if the CV is static and hasn't been initialised yet.   * Assuming that any race condition is harmless.   */  if (cv == (pthread_cond_t) PTW32_OBJECT_AUTO_INIT)    {(cv      return 0;    }  /*   * Synchronize access to waiters blocked count (LEVEL-1)   */  if (sem_wait(&(cv->semBlockLock)) != 0)    {(sem_wait(&(cv->semBlockLock))      return errno;    }  /*   * Synchronize access to waiters (to)unblock(ed) counts (LEVEL-2)   * This sync.level supports _timedwait and cancellation   */  if ((result = pthread_mutex_lock(&(cv->mtxUnblockLock))) != 0)    {((result      return result;    }  /*   * Adjust waiters blocked and unblocked counts (collect garbage)   */  if (cv->nWaitersUnblocked != 0)    {(cv->nWaitersUnblocked      cv->nWaitersBlocked  -= cv->nWaitersUnblocked;      cv->nWaitersUnblocked = 0;    }  /*   * If (after adjustment) there are still some waiters blocked counted...   */  if ( cv->nWaitersBlocked > 0)    {(      /*       * We will unblock first waiter and leave semBlockLock/LEVEL-1 locked       * LEVEL-1 access is left disabled until last signal/unblockcompletes       */      cv->nWaitersToUnblock = (unblockAll) ? cv->nWaitersBlocked : 1;      /*       * No more LEVEL-2 access to waiters (to)unblock(ed) counts needed       * This sync.level supports _timedwait and cancellation       */      if ((result = pthread_mutex_unlock(&(cv->mtxUnblockLock))) != 0)        {((result          return result;        }      /*       * Now, with LEVEL-2 lock released let first waiter go throughsemaphore       */      if (sem_post(&(cv->semBlockQueue)) != 0)        {(sem_post(&(cv->semBlockQueue))          return errno;        }    }  /*   * No waiter blocked - no more LEVEL-1 access to blocked count needed...   */  else if (sem_post(&(cv->semBlockLock)) != 0)    {      return errno;    }  /*   * ...and no more LEVEL-2 access to waiters (to)unblock(ed) counts needed

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人你懂的| 色综合激情久久| 7777精品伊人久久久大香线蕉的| 国产精品美女久久久久av爽李琼| 精品一区中文字幕| 欧美精品视频www在线观看| 综合电影一区二区三区 | 欧美在线短视频| 亚洲另类春色国产| 91精品国产综合久久久蜜臀图片 | 一区二区三区在线观看国产| 色狠狠av一区二区三区| 免费在线看成人av| 国产欧美日本一区视频| 成人午夜看片网址| 亚洲青青青在线视频| 日韩电影在线一区二区三区| 69堂国产成人免费视频| 国产河南妇女毛片精品久久久| 国产欧美一区二区精品忘忧草 | a美女胸又www黄视频久久| 亚洲精品免费电影| 国产亚洲一二三区| 777xxx欧美| 欧美视频精品在线| 五月开心婷婷久久| 国产精品久久久久久久久晋中| 在线观看免费亚洲| av在线播放成人| 奇米影视在线99精品| 最好看的中文字幕久久| 久久久久亚洲蜜桃| 欧美一级免费观看| 欧美综合色免费| 欧美日韩免费高清一区色橹橹| 国产成人综合视频| 国产酒店精品激情| 国产一区二区三区香蕉| 国产一区二区精品久久99| 日本亚洲天堂网| 看国产成人h片视频| 婷婷综合五月天| 国产精品麻豆99久久久久久| 国产亚洲女人久久久久毛片| 国产欧美日韩精品a在线观看| 国产欧美日韩综合| 日韩视频一区在线观看| 日韩你懂的在线播放| 精品国产一区二区亚洲人成毛片| 国产喂奶挤奶一区二区三区| 亚洲欧美综合另类在线卡通| 婷婷夜色潮精品综合在线| 国产一区二区三区四区五区入口| 国产乱人伦偷精品视频免下载| 色综合天天综合网天天狠天天 | 国内精品久久久久影院薰衣草| 成人免费高清在线| 欧美精品18+| 亚洲视频综合在线| 国产精品 日产精品 欧美精品| 91麻豆免费观看| 国产女人18毛片水真多成人如厕| 亚洲一区二区在线免费观看视频| 国产精品夜夜爽| 欧美一卡二卡在线| 亚洲mv在线观看| 一本大道综合伊人精品热热| 日韩一级黄色片| 天堂影院一区二区| 欧美性生交片4| 一区二区三区精密机械公司| 成人午夜视频在线观看| 中文字幕精品一区二区精品绿巨人 | 日韩精品在线看片z| 日韩激情视频在线观看| 91在线免费看| 亚洲日本va午夜在线影院| 国产精品一区不卡| 国产欧美日韩卡一| 成人综合婷婷国产精品久久蜜臀| 久久久蜜桃精品| 国产成人精品影院| 亚洲国产精华液网站w| www国产精品av| 成人一区二区三区中文字幕| 国产精品久久久久久久岛一牛影视| 亚洲电影第三页| 成人毛片在线观看| 久久久久久久国产精品影院| 亚洲国产精品久久不卡毛片| 国产精品一色哟哟哟| 欧美人伦禁忌dvd放荡欲情| 久久午夜电影网| 国产三级欧美三级| 国产精品久久久久久久浪潮网站 | 波多野结衣在线一区| 亚洲福利视频三区| 一本色道a无线码一区v| 国产精品久久午夜| 在线视频欧美精品| 亚洲aaa精品| 欧美三级午夜理伦三级中视频| 亚洲精品一二三| 91久久精品日日躁夜夜躁欧美| 日韩视频一区二区在线观看| 狠狠久久亚洲欧美| 欧美国产日本视频| 欧美日本乱大交xxxxx| 成人理论电影网| 韩国精品一区二区| 一区二区在线看| 91视视频在线直接观看在线看网页在线看 | 欧美久久久久久久久| 天天色天天操综合| 中文字幕中文字幕一区二区| 欧美日韩午夜精品| 91久久久免费一区二区| 91原创在线视频| 色呦呦国产精品| 欧美tickling挠脚心丨vk| 在线不卡a资源高清| 成年人国产精品| 91社区在线播放| 欧美久久高跟鞋激| 91精品国产手机| 久久久亚洲精品一区二区三区 | 色综合久久综合网欧美综合网| 一本大道综合伊人精品热热| 久久久久久久久岛国免费| 麻豆精品久久精品色综合| 亚洲精品成人精品456| 亚洲不卡av一区二区三区| 日韩国产精品久久久久久亚洲| 久久国内精品视频| 色偷偷久久人人79超碰人人澡| 欧洲视频一区二区| 精品久久久久av影院| 国产精品免费aⅴ片在线观看| 亚洲黄色免费网站| 麻豆高清免费国产一区| 91麻豆产精品久久久久久| 在线成人小视频| 最近中文字幕一区二区三区| 日本美女视频一区二区| 色综合久久久久网| 久久久精品免费免费| 视频一区二区三区在线| 成人av网址在线| 久久久亚洲精华液精华液精华液| 亚洲视频狠狠干| av午夜精品一区二区三区| 欧美一区二区高清| 蜜桃av一区二区在线观看| 欧美日韩另类国产亚洲欧美一级| 亚洲人成网站色在线观看| 国产成人在线视频网址| 久久久91精品国产一区二区三区| 亚洲高清一区二区三区| 欧美色网站导航| 午夜欧美大尺度福利影院在线看| 91行情网站电视在线观看高清版| 国产精品乱码妇女bbbb| 91免费看片在线观看| 亚洲男人的天堂在线aⅴ视频| caoporm超碰国产精品| 亚洲一区二区三区免费视频| 欧美日韩久久久久久| 久久精品国产在热久久| 精品国产乱码久久久久久久久| 久久99久国产精品黄毛片色诱| 日韩一区二区麻豆国产| 国产.欧美.日韩| 樱桃视频在线观看一区| 日韩欧美资源站| 成人sese在线| 亚洲高清视频中文字幕| 久久免费电影网| 欧美丝袜自拍制服另类| 久久99国产精品尤物| 亚洲精品国产一区二区精华液| 欧美无砖砖区免费| 国产高清一区日本| 天天免费综合色| 亚洲欧洲精品一区二区三区不卡 | 91网站在线播放| 蜜臀久久99精品久久久久久9| 亚洲国产精品成人综合| 日韩精品专区在线| 欧美日韩综合色| 欧洲激情一区二区| 色屁屁一区二区| 成人aa视频在线观看| 久久99深爱久久99精品| 亚洲制服丝袜av| 亚洲免费观看高清完整版在线观看 | 欧美日韩国产成人在线免费| 91在线高清观看| av网站一区二区三区| 91色在线porny| 一本在线高清不卡dvd|