From 33ad7ee917e7d3e9aad2817624876c5d125057da Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sat, 27 May 2023 02:03:07 +0900 Subject: [PATCH] fix memory wait for user scheduler (cont) fix a bug in "fix memory wait for user scheduler" commit also, add a trace --- lib/waitlist.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/waitlist.c b/lib/waitlist.c index 23c9ffc3..0ba12483 100644 --- a/lib/waitlist.c +++ b/lib/waitlist.c @@ -143,8 +143,8 @@ waiter_block(struct waiter_list *l, struct toywasm_mutex *lock, if (ret == ETIMEDOUT) { #if defined(TOYWASM_USE_USER_SCHED) struct timespec now; - ret = timespec_now(CLOCK_REALTIME, &now); - if (ret != 0) { + int ret1 = timespec_now(CLOCK_REALTIME, &now); + if (ret1 != 0) { break; } if (timespec_cmp(&now, abstimeout) < 0) { @@ -159,6 +159,7 @@ waiter_block(struct waiter_list *l, struct toywasm_mutex *lock, } assert(ret == 0); } + xlog_trace("%s: woken=%d, ret=%d", __func__, (int)w->woken, ret); return ret; }