FS-9820 #resolve [Add thread_pool to libks]

This commit is contained in:
Anthony Minessale committed 2016-12-06 16:46:08 -06:00
1 parent b86f7a6d30
commit b6df83dd10
8 files changed
+339 -4

No files matched your search

+6 -2
View File
@@ -393,10 +393,14 @@ KS_DECLARE(ks_status_t) ks_cond_timedwait(ks_cond_t *cond, ks_time_t ms)
#else
struct timespec ts;
ks_time_t n = ks_time_now() + (ms * 1000);
int r = 0;
ts.tv_sec = ks_time_sec(n);
ts.tv_nsec = ks_time_nsec(n);
if (pthread_cond_timedwait(&cond->cond, &cond->mutex->mutex, &ts)) {
switch(errno) {
r = pthread_cond_timedwait(&cond->cond, &cond->mutex->mutex, &ts);
if (r) {
switch(r) {
case ETIMEDOUT:
return KS_STATUS_TIMEOUT;
default: