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

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

?? pthread_cond_destroy.c

?? pthread source code,you can compile directly
?? C
字號:
/* * pthread_cond_destroy.c * * Description: * This translation unit implements condition variables and their primitives. * * * -------------------------------------------------------------------------- * *      Pthreads-win32 - POSIX Threads Library for Win32 *      Copyright(C) 1998 John E. Bossom *      Copyright(C) 1999,2005 Pthreads-win32 contributors *  *      Contact Email: rpj@callisto.canberra.edu.au *  *      The current list of contributors is contained *      in the file CONTRIBUTORS included with the source *      code distribution. The list can also be seen at the *      following World Wide Web location: *      http://sources.redhat.com/pthreads-win32/contributors.html *  *      This library is free software; you can redistribute it and/or *      modify it under the terms of the GNU Lesser General Public *      License as published by the Free Software Foundation; either *      version 2 of the License, or (at your option) any later version. *  *      This library is distributed in the hope that it will be useful, *      but WITHOUT ANY WARRANTY; without even the implied warranty of *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *      Lesser General Public License for more details. *  *      You should have received a copy of the GNU Lesser General Public *      License along with this library in the file COPYING.LIB; *      if not, write to the Free Software Foundation, Inc., *      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */#include "pthread.h"#include "implement.h"intpthread_cond_destroy (pthread_cond_t * cond)     /*      * ------------------------------------------------------      * DOCPUBLIC      *      This function destroys a condition variable      *      *      * PARAMETERS      *      cond      *              pointer to an instance of pthread_cond_t      *      *      * DESCRIPTION      *      This function destroys a condition variable.      *      *      NOTES:      *              1)      A condition variable can be destroyed      *                      immediately after all the threads that      *                      are blocked on it are awakened. e.g.      *      *                      struct list {      *                        pthread_mutex_t lm;      *                        ...      *                      }      *      *                      struct elt {      *                        key k;      *                        int busy;      *                        pthread_cond_t notbusy;      *                        ...      *                      }      *      *                            *                      struct elt *      *                      list_find(struct list *lp, key k)      *                      {      *                        struct elt *ep;      *      *                        pthread_mutex_lock(&lp->lm);      *                        while ((ep = find_elt(l,k) != NULL) && ep->busy)      *                          pthread_cond_wait(&ep->notbusy, &lp->lm);      *                        if (ep != NULL)      *                          ep->busy = 1;      *                        pthread_mutex_unlock(&lp->lm);      *                        return(ep);      *                      }      *      *                      delete_elt(struct list *lp, struct elt *ep)      *                      {      *                        pthread_mutex_lock(&lp->lm);      *                        assert(ep->busy);      *                        ... remove ep from list ...      *                        ep->busy = 0;      *                    (A) pthread_cond_broadcast(&ep->notbusy);      *                        pthread_mutex_unlock(&lp->lm);      *                    (B) pthread_cond_destroy(&rp->notbusy);      *                        free(ep);      *                      }      *      *                      In this example, the condition variable      *                      and its list element may be freed (line B)      *                      immediately after all threads waiting for      *                      it are awakened (line A), since the mutex      *                      and the code ensure that no other thread      *                      can touch the element to be deleted.      *      * RESULTS      *              0               successfully released condition variable,      *              EINVAL          'cond' is invalid,      *              EBUSY           'cond' is in use,      *      * ------------------------------------------------------      */{  pthread_cond_t cv;  int result = 0, result1 = 0, result2 = 0;  /*   * Assuming any race condition here is harmless.   */  if (cond == NULL || *cond == NULL)    {      return EINVAL;    }  if (*cond != PTHREAD_COND_INITIALIZER)    {      EnterCriticalSection (&ptw32_cond_list_lock);      cv = *cond;      /*       * Close the gate; this will synchronize this thread with       * all already signaled waiters to let them retract their       * waiter status - SEE NOTE 1 ABOVE!!!       */      if (sem_wait (&(cv->semBlockLock)) != 0)	{	  return errno;	}      /*       * !TRY! lock mtxUnblockLock; try will detect busy condition       * and will not cause a deadlock with respect to concurrent       * signal/broadcast.       */      if ((result = pthread_mutex_trylock (&(cv->mtxUnblockLock))) != 0)	{	  (void) sem_post (&(cv->semBlockLock));	  return result;	}      /*       * Check whether cv is still busy (still has waiters)       */      if (cv->nWaitersBlocked > cv->nWaitersGone)	{	  if (sem_post (&(cv->semBlockLock)) != 0)	    {	      result = errno;	    }	  result1 = pthread_mutex_unlock (&(cv->mtxUnblockLock));	  result2 = EBUSY;	}      else	{	  /*	   * Now it is safe to destroy	   */	  *cond = NULL;	  if (sem_destroy (&(cv->semBlockLock)) != 0)	    {	      result = errno;	    }	  if (sem_destroy (&(cv->semBlockQueue)) != 0)	    {	      result1 = errno;	    }	  if ((result2 = pthread_mutex_unlock (&(cv->mtxUnblockLock))) == 0)	    {	      result2 = pthread_mutex_destroy (&(cv->mtxUnblockLock));	    }	  /* Unlink the CV from the list */	  if (ptw32_cond_list_head == cv)	    {	      ptw32_cond_list_head = cv->next;	    }	  else	    {	      cv->prev->next = cv->next;	    }	  if (ptw32_cond_list_tail == cv)	    {	      ptw32_cond_list_tail = cv->prev;	    }	  else	    {	      cv->next->prev = cv->prev;	    }	  (void) free (cv);	}      LeaveCriticalSection (&ptw32_cond_list_lock);    }  else    {      /*       * See notes in ptw32_cond_check_need_init() above also.       */      EnterCriticalSection (&ptw32_cond_test_init_lock);      /*       * Check again.       */      if (*cond == PTHREAD_COND_INITIALIZER)	{	  /*	   * 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. That's OK.	   */	  *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 != 0) ? result : ((result1 != 0) ? result1 : result2));}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久综合视频| 国产精品久久久久aaaa樱花| 久久久久一区二区三区四区| 亚洲欧美日韩在线| 国内精品不卡在线| 欧美人与z0zoxxxx视频| 国产精品久久久久久久岛一牛影视 | 国产农村妇女毛片精品久久麻豆 | 91在线精品秘密一区二区| 欧美丰满嫩嫩电影| 亚洲视频在线观看三级| 久久精品理论片| 欧美日韩精品一区视频| 亚洲欧洲在线观看av| 国产一区二区三区美女| 91精品国产91久久久久久一区二区 | 久久亚洲精品小早川怜子| 香蕉成人啪国产精品视频综合网| 成人性视频免费网站| 久久久噜噜噜久久人人看| 美国十次了思思久久精品导航| 在线欧美一区二区| 亚洲欧美一区二区三区久本道91| 国产精品一二三四五| 精品成a人在线观看| 美女在线视频一区| 欧美成人精品1314www| 青青草国产成人99久久| 91精品国产综合久久久蜜臀图片| 亚洲第一精品在线| 欧美日韩国产天堂| 五月天视频一区| 666欧美在线视频| 天堂一区二区在线免费观看| 欧美日韩aaa| 日韩成人午夜精品| 日韩欧美成人激情| 国产在线国偷精品产拍免费yy| 欧美一区二区三区在线观看 | 日韩一区二区免费在线电影| 视频一区视频二区中文字幕| 欧美日韩国产一级| 毛片一区二区三区| 精品国产免费视频| 国产成人在线视频网址| 国产精品久久久久一区二区三区 | 国产成人精品1024| 国产精品区一区二区三| 99视频精品全部免费在线| 亚洲人亚洲人成电影网站色| 在线观看视频一区二区| 婷婷国产在线综合| 精品免费国产二区三区| 成人av网站免费| 一区二区免费在线播放| 欧美高清一级片在线| 久草在线在线精品观看| 国产精品麻豆视频| 欧美伊人久久久久久久久影院| 日韩av一区二| 国产欧美精品一区二区色综合| 色综合久久88色综合天天6| 亚洲1区2区3区4区| 精品88久久久久88久久久| 91视频免费看| 伦理电影国产精品| 国产精品国产三级国产三级人妇 | 日韩电影免费在线| 中文无字幕一区二区三区| 91香蕉视频污在线| 奇米影视一区二区三区小说| 国产精品无人区| 7878成人国产在线观看| 成人综合在线网站| 日产国产欧美视频一区精品| 国产农村妇女精品| 欧美一级午夜免费电影| 91免费观看视频| 精一区二区三区| 亚洲综合网站在线观看| 久久久精品人体av艺术| 欧美色图天堂网| 成人影视亚洲图片在线| 日韩制服丝袜av| 1024亚洲合集| 久久久久亚洲蜜桃| 这里只有精品视频在线观看| 99国产欧美久久久精品| 国内外精品视频| 日韩va亚洲va欧美va久久| 亚洲色图在线播放| 久久精品视频在线看| 欧美一级一区二区| 欧美精品1区2区| 欧美日韩中字一区| 一本大道久久精品懂色aⅴ| 国产精品1024| 老司机精品视频一区二区三区| 亚洲综合清纯丝袜自拍| 亚洲男同1069视频| 国产精品视频免费| 欧美精品一区在线观看| 精品国产乱码久久久久久久| 日韩一级黄色大片| 欧美日韩国产在线播放网站| 91福利在线导航| 97aⅴ精品视频一二三区| 国产91精品一区二区麻豆网站| 国内精品视频一区二区三区八戒| 日韩黄色在线观看| 日韩精品一二区| 天堂成人国产精品一区| 三级一区在线视频先锋 | 国产精品一区二区三区四区| 日韩精品亚洲专区| 欧美aⅴ一区二区三区视频| 亚洲gay无套男同| 性久久久久久久久| 日韩一区精品字幕| 美女一区二区视频| 老司机免费视频一区二区三区| 美脚の诱脚舐め脚责91| 久久精品99久久久| 国产美女精品一区二区三区| 国产成人在线影院| 99re66热这里只有精品3直播 | 51精品秘密在线观看| 欧美精品色综合| 制服.丝袜.亚洲.中文.综合| 精品久久久久久最新网址| 精品久久国产老人久久综合| 国产亚洲一二三区| 亚洲丝袜精品丝袜在线| 亚洲国产成人va在线观看天堂| 丝袜诱惑亚洲看片| 国产一区视频网站| 91麻豆免费观看| 欧美精品在欧美一区二区少妇| 欧美乱妇20p| 精品国产91亚洲一区二区三区婷婷| 久久新电视剧免费观看| 国产精品精品国产色婷婷| 亚洲最新视频在线观看| 美女视频免费一区| 国产99久久久国产精品潘金网站| 色八戒一区二区三区| 日韩欧美专区在线| 欧美国产日韩亚洲一区| 性感美女极品91精品| 国产精品1区2区| 欧美亚洲禁片免费| 久久综合久久久久88| 亚洲欧美日韩精品久久久久| 日韩电影网1区2区| 99热精品国产| 日韩免费观看高清完整版| 亚洲日本一区二区| 久久精品国产久精国产爱| 色综合久久88色综合天天6 | 欧美精品精品一区| 国产女同性恋一区二区| 天天色天天爱天天射综合| 国产成人啪免费观看软件| 色婷婷一区二区| 在线精品视频一区二区| 一级中文字幕一区二区| 欧美丰满少妇xxxbbb| 婷婷综合在线观看| 一区二区三国产精华液| 国产精品中文字幕日韩精品| 欧美日韩国产经典色站一区二区三区| 欧美精品一区二区高清在线观看| 亚洲欧美一区二区三区国产精品 | 欧美精品一区二区久久婷婷| 亚洲人成7777| 国产成人综合在线播放| 日韩欧美在线观看一区二区三区| 亚洲天堂成人网| 国产一区二区视频在线| 欧美一区永久视频免费观看| 亚洲码国产岛国毛片在线| 成人综合在线视频| 久久久久99精品一区| 免费成人av在线| 欧美美女直播网站| 性做久久久久久久免费看| 在线中文字幕不卡| 亚洲精品日韩一| aaa亚洲精品一二三区| 久久久精品一品道一区| 精品在线播放免费| 日韩精品中文字幕一区二区三区| 性做久久久久久久免费看| 欧美日韩国产在线播放网站| 亚洲一区二区三区美女| 在线观看日韩毛片| 亚洲一区二区三区爽爽爽爽爽 | 亚洲图片欧美综合| 在线视频综合导航| 亚洲国产va精品久久久不卡综合|