pthread_cond_timedwait() broken in 9-stable? (from JAN 10)

看板FB_stable作者時間14年前 (2012/02/16 06:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/16 (看更多)
The program fio (an IO test in ports) uses pthreads the following code (from fio-2.0.3, but its in earlier code too) has suddenly started misbehaving. clock_gettime(CLOCK_REALTIME, &t); t.tv_sec += seconds + 10; pthread_mutex_lock(&mutex->lock); while (!mutex->value && !ret) { mutex->waiters++; ret = pthread_cond_timedwait(&mutex->cond, &mutex->lock, &t); mutex->waiters--; } if (!ret) { mutex->value--; pthread_mutex_unlock(&mutex->lock); } It turns out that 'ret' sometimes comes back instantly (on my machine) with a value of 60 (ETIMEDOUT) despite the fact that we set the timeout 10 seconds into the future. Has anyone else seen anything like this? (and yes the condition variable attribute have been set to use the REALTIME clock). _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"
文章代碼(AID): #1FF2iV_y (FB_stable)
討論串 (同標題文章)
完整討論串 (本文為第 1 之 16 篇):
文章代碼(AID): #1FF2iV_y (FB_stable)