In the code below, the timespec argument to pthread_cond_timedwait() is set to an invalid value: t_nsec > 999,999,999 so, EINVAL error code should be returned.
Regards, Ivan Mari #include <pthread.h> #include <unistd.h> #include <stdio.h> #include <sys/time.h> #include <errno.h> void* start_routine( void* arg ); pthread_cond_t m_cond = PTHREAD_COND_INITIALIZER; pthread_mutex_t m_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; int main() { struct timespec t; t.tv_nsec = 1000000000; /* This value should be in the range 0 < tv_nsec < 999999999 */ t.tv_sec = 1145259964; pthread_mutex_lock( &m_lock ); printf("Entering cond wait \n"); int rv = pthread_cond_timedwait( &m_cond, &m_lock, &t ); if( rv ) { switch( rv ) { case ETIMEDOUT: printf("Error timeout before receiving signal\n"); break; case EINVAL: printf("Error invalid abstime or mutex or cond\n"); break; case EPERM: printf("Error thread doesn't own mutex\n"); break; } } printf("pthread_cond_wait returned %d\n",rv); pthread_mutex_unlock( &m_lock ); return 0; } -- Echte DSL-Flatrate dauerhaft für 0,- Euro*! "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/