support zero tokens in wait_any
@@ -46,6 +46,8 @@ int dmtr_wait_any(dmtr_qresult_t *qr_out, int *ready_offset, dmtr_qtoken_t qts[]
#if DMTR_PROFILE
auto t0 = boost::chrono::steady_clock::now();
#endif
+ // just ignore zero tokens
+ if (qts[i] != 0) {
int ret = dmtr_poll(qr_out, qts[i]);
if (ret != EAGAIN) {
if (ret == 0) {
@@ -59,6 +61,7 @@ int dmtr_wait_any(dmtr_qresult_t *qr_out, int *ready_offset, dmtr_qtoken_t qts[]
return ret;
}
}
+ }
i++;
if (i == num_qts) i = 0;
}
