/* * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by: bing.wei.liu REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. * Test that pthread_cond_signal() * When each thread unblocked as a result of pthread_cond_signal() * returns from its call to pthread_cond_wait(), the thread shall * own the mutex with which it called pthread_cond_wait(). */ #define _XOPEN_SOURCE 600 #include #include #include #include #include #include "posixtest.h" #define THREAD_NUM 3 struct testdata { pthread_mutex_t mutex; pthread_cond_t cond; } td; pthread_t thread[THREAD_NUM]; int start_num = 0; int waken_num = 0; /* Alarm handler */ void alarm_handler(int signo) { int i; printf("Error: failed to wakeup all threads\n"); for (i=0; i