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

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

?? condvar7.c

?? pthread source code,you can compile directly
?? C
字號:
/* * File: condvar7.c * * * -------------------------------------------------------------------------- * *      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 * * -------------------------------------------------------------------------- * * Test Synopsis: * - Test pthread_cond_broadcast with thread cancelation. * * Test Method (Validation or Falsification): * - Validation * * Requirements Tested: * -  * * Features Tested: * -  * * Cases Tested: * -  * * Description: * - Test broadcast with NUMTHREADS (=5) waiting CVs, one is canceled while waiting. * * Environment: * -  * * Input: * - None. * * Output: * - File name, Line number, and failed expression on failure. * - No output on success. * * Assumptions: * -  * * Pass Criteria: * - Process returns zero exit status. * * Fail Criteria: * - Process returns non-zero exit status. */#include "test.h"#include <sys/timeb.h>/* * Create NUMTHREADS threads in addition to the Main thread. */enum {  NUMTHREADS = 5};typedef struct bag_t_ bag_t;struct bag_t_ {  int threadnum;  int started;  /* Add more per-thread state variables here */};static bag_t threadbag[NUMTHREADS + 1];typedef struct cvthing_t_ cvthing_t;struct cvthing_t_ {  pthread_cond_t notbusy;  pthread_mutex_t lock;  int shared;};static cvthing_t cvthing = {  PTHREAD_COND_INITIALIZER,  PTHREAD_MUTEX_INITIALIZER,  0};static pthread_mutex_t start_flag = PTHREAD_MUTEX_INITIALIZER;static struct timespec abstime = { 0, 0 };static int awoken;void *mythread(void * arg){  bag_t * bag = (bag_t *) arg;  assert(bag == &threadbag[bag->threadnum]);  assert(bag->started == 0);  bag->started = 1;  /* Wait for the start gun */  assert(pthread_mutex_lock(&start_flag) == 0);  assert(pthread_mutex_unlock(&start_flag) == 0);  assert(pthread_mutex_lock(&cvthing.lock) == 0);#ifdef _MSC_VER#pragma inline_depth(0)#endif  pthread_cleanup_push(pthread_mutex_unlock, (void *) &cvthing.lock);  while (! (cvthing.shared > 0))    assert(pthread_cond_timedwait(&cvthing.notbusy, &cvthing.lock, &abstime) == 0);  pthread_cleanup_pop(0);#ifdef _MSC_VER#pragma inline_depth()#endif  assert(cvthing.shared > 0);  awoken++;  assert(pthread_mutex_unlock(&cvthing.lock) == 0);  return (void *) 0;}intmain(){  int failed = 0;  int i;  pthread_t t[NUMTHREADS + 1];  struct _timeb currSysTime;  const DWORD NANOSEC_PER_MILLISEC = 1000000;  cvthing.shared = 0;  assert((t[0] = pthread_self()).p != NULL);  assert(cvthing.notbusy == PTHREAD_COND_INITIALIZER);  assert(cvthing.lock == PTHREAD_MUTEX_INITIALIZER);  assert(pthread_mutex_lock(&start_flag) == 0);  _ftime(&currSysTime);  abstime.tv_sec = currSysTime.time;  abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;  abstime.tv_sec += 10;  assert((t[0] = pthread_self()).p != NULL);  awoken = 0;  for (i = 1; i <= NUMTHREADS; i++)    {      threadbag[i].started = 0;      threadbag[i].threadnum = i;      assert(pthread_create(&t[i], NULL, mythread, (void *) &threadbag[i]) == 0);    }  /*   * Code to control or munipulate child threads should probably go here.   */  assert(pthread_mutex_unlock(&start_flag) == 0);  /*   * Give threads time to start.   */  Sleep(1000);  /*   * Cancel one of the threads.   */  assert(pthread_cancel(t[1]) == 0);  assert(pthread_join(t[1], NULL) == 0);  assert(pthread_mutex_lock(&cvthing.lock) == 0);  cvthing.shared++;  assert(pthread_mutex_unlock(&cvthing.lock) == 0);  /*   * Signal all remaining waiting threads.   */  assert(pthread_cond_broadcast(&cvthing.notbusy) == 0);  /*   * Wait for all threads to complete.   */  for (i = 2; i <= NUMTHREADS; i++)    assert(pthread_join(t[i], NULL) == 0);  /*    * Cleanup the CV.   */    assert(pthread_mutex_destroy(&cvthing.lock) == 0);  assert(cvthing.lock == NULL);  assert(pthread_cond_destroy(&cvthing.notbusy) == 0);  assert(cvthing.notbusy == NULL);  /*   * Standard check that all threads started.   */  for (i = 1; i <= NUMTHREADS; i++)    {       failed = !threadbag[i].started;      if (failed)	{	  fprintf(stderr, "Thread %d: started %d\n", i, threadbag[i].started);	}    }  assert(!failed);  /*   * Check any results here.   */  assert(awoken == (NUMTHREADS - 1));  /*   * Success.   */  return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久99| 一区二区三区在线看| 中文字幕精品一区| 亚洲一区在线电影| 国产一区不卡视频| 欧美影院一区二区三区| 久久人人超碰精品| 亚洲一区二区三区四区在线观看 | 91麻豆精品国产91久久久更新时间 | 久久精品国产一区二区三| 春色校园综合激情亚洲| 日韩网站在线看片你懂的| 亚洲视频免费在线观看| 日韩电影在线一区二区三区| 成人高清av在线| 亚洲精品一线二线三线| 亚洲高清视频的网址| www.日韩av| 中文字幕欧美区| 国产综合成人久久大片91| 欧美日韩视频在线第一区 | 韩国av一区二区三区在线观看| 97国产精品videossex| 精品国产区一区| 日本一区中文字幕| 91久久精品网| 亚洲激情综合网| 91丨九色porny丨蝌蚪| 欧美极品xxx| 国产91精品在线观看| 精品999久久久| 国产一区二区三区电影在线观看| 欧美一区二区精美| 免费av成人在线| 欧美大片在线观看一区| 天使萌一区二区三区免费观看| 91亚洲精品一区二区乱码| 中文字幕一区二区三区不卡| 成人性生交大片免费看中文网站| 26uuuu精品一区二区| 捆绑变态av一区二区三区| 欧美一区二区三区四区五区| 亚洲二区在线观看| 欧美日本视频在线| 日产国产欧美视频一区精品| 欧美精品在欧美一区二区少妇| 亚洲影院在线观看| 欧美日韩在线免费视频| 五月婷婷激情综合| 91精品黄色片免费大全| 视频一区二区中文字幕| 日韩欧美久久一区| 国产福利一区二区三区| 国产精品天美传媒| 日本韩国欧美一区二区三区| 亚洲观看高清完整版在线观看| 欧美日韩午夜在线视频| 日韩精品视频网站| www国产亚洲精品久久麻豆| 高清视频一区二区| 亚洲综合精品自拍| 日韩一级视频免费观看在线| 国产米奇在线777精品观看| 国产精品视频看| 欧美日本一道本| 国产久卡久卡久卡久卡视频精品| 国产精品电影院| 欧美年轻男男videosbes| 玖玖九九国产精品| 亚洲免费av高清| 日韩色视频在线观看| 波多野结衣在线一区| 亚洲国产精品自拍| 国产午夜精品美女毛片视频| 一本色道综合亚洲| 另类小说视频一区二区| 亚洲三级在线免费| 日韩一区二区在线看| 9色porny自拍视频一区二区| 婷婷开心激情综合| 中文字幕一区二区三中文字幕| 在线电影院国产精品| 丰满岳乱妇一区二区三区| 婷婷国产v国产偷v亚洲高清| 国产精品久久久久天堂| 日韩一区二区三| 91黄视频在线| 国产盗摄一区二区三区| 亚洲一级二级三级| 国产精品色哟哟| 精品久久久久久无| 欧美在线免费视屏| 懂色av噜噜一区二区三区av| 日韩不卡在线观看日韩不卡视频| 中文字幕制服丝袜成人av | 成人av网站在线| 久久电影网站中文字幕| 一区二区三区免费观看| 国产精品免费看片| 久久久久久**毛片大全| 欧美一区二区福利视频| 欧美午夜不卡在线观看免费| www.成人在线| 国产精品一区久久久久| 日韩1区2区3区| 亚洲6080在线| 亚洲与欧洲av电影| 亚洲精品国产精华液| 国产精品卡一卡二| 国产日产精品一区| 久久九九久精品国产免费直播| 欧美一区二区三区男人的天堂 | 成人涩涩免费视频| 国产传媒欧美日韩成人| 精品亚洲成a人| 麻豆久久久久久| 天天色综合成人网| 日韩中文字幕一区二区三区| 亚洲第一av色| 丝袜亚洲精品中文字幕一区| 亚洲国产cao| 五月天激情小说综合| 三级不卡在线观看| 天天做天天摸天天爽国产一区| 日韩成人免费电影| 九九视频精品免费| 国产在线播放一区三区四| 蜜桃91丨九色丨蝌蚪91桃色| 狠狠色伊人亚洲综合成人| 激情五月婷婷综合网| 国产一区91精品张津瑜| 成人午夜精品一区二区三区| jvid福利写真一区二区三区| 99久久免费精品高清特色大片| 91啪在线观看| 欧洲生活片亚洲生活在线观看| 在线观看日韩毛片| 7777精品伊人久久久大香线蕉经典版下载| 欧美三区免费完整视频在线观看| 欧美日韩国产成人在线91| 日韩欧美123| 中文字幕av一区 二区| 亚洲人成网站色在线观看| 亚洲成a人在线观看| 精品一区二区免费在线观看| 成人午夜在线免费| 91久久精品一区二区三区| 日韩一区二区三区av| 中文在线一区二区| 亚洲成av人片一区二区| 久久99国产精品久久99果冻传媒| 国产69精品久久久久毛片| 一本一道综合狠狠老| 日韩欧美一级片| 国产精品毛片久久久久久| 亚洲成av人在线观看| 国产成都精品91一区二区三| 在线免费亚洲电影| 久久婷婷国产综合国色天香| 亚洲乱码精品一二三四区日韩在线 | 国产精品麻豆一区二区| 天天av天天翘天天综合网| 国产精品一级黄| 欧美日韩精品二区第二页| 中文字幕高清一区| 蜜臀精品一区二区三区在线观看| 波多野结衣精品在线| 日韩你懂的在线播放| 亚洲柠檬福利资源导航| 久久99热狠狠色一区二区| 91免费版pro下载短视频| 精品免费国产二区三区| 亚洲一区二区视频| 国产成人综合自拍| 日韩三级精品电影久久久 | 亚洲永久精品国产| 成人国产精品视频| 欧美不卡123| 亚洲成人免费在线观看| 国产99精品视频| 精品国产电影一区二区| 午夜影院久久久| 欧洲人成人精品| 亚洲私人黄色宅男| 成人做爰69片免费看网站| 欧美mv日韩mv国产网站| 日韩av一级电影| 色偷偷一区二区三区| 国产精品免费免费| 成人精品gif动图一区| 日韩欧美国产一区在线观看| 亚洲一区二区三区免费视频| av一区二区三区四区| 久久精品水蜜桃av综合天堂| 激情文学综合网| 日韩片之四级片| 美日韩一区二区| 国产精品污www在线观看| 国产美女精品在线| 久久夜色精品国产噜噜av|