Timeout test passes on windows

This commit is contained in:
Bert Belder 2011-04-15 19:43:28 +02:00
parent 1ce1f82ca3
commit 0ffc8b6240
2 changed files with 3 additions and 2 deletions

View File

@ -673,6 +673,7 @@ int oio_timeout(oio_req* req, int64_t timeout) {
return -1;
}
oio_refs_++;
req->flags |= OIO_REQ_PENDING;
return 0;
}
@ -738,6 +739,7 @@ static void oio_poll() {
req = RB_MIN(oio_timer_s, &oio_timers_)) {
RB_REMOVE(oio_timer_s, &oio_timers_, req);
req->flags &= ~OIO_REQ_PENDING;
oio_refs_--;
((oio_timer_cb)req->cb)(req, req->due - oio_now_);
}

View File

@ -14,7 +14,6 @@ void timeout_cb(oio_req *req) {
void exit_timeout_cb(oio_req *req) {
ASSERT(req != NULL);
free(req);
ASSERT(timeouts == expected);
exit(0);
}
@ -33,7 +32,7 @@ TEST_IMPL(timeout) {
oio_init();
/* Let 10 timers time out it 500 ms. */
/* Let 10 timers time out in 500 ms total. */
for (i = 0; i < 10; i++) {
req = (oio_req*)malloc(sizeof(*req));
ASSERT(req != NULL)