From 7235e6ffc21a45ca841ffee9b7f31e6dd375042b Mon Sep 17 00:00:00 2001 From: Hajime Tazaki Date: Fri, 1 May 2015 15:18:46 +0900 Subject: [PATCH] tools: work around for double link_del --- nuse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nuse.c b/nuse.c index df924b4..85acae7 100644 --- a/nuse.c +++ b/nuse.c @@ -175,7 +175,8 @@ static void *nuse_task_start_trampoline(void *context) callback(callback_context); /* nuse_fiber_free (task->private); */ - list_del(&task->head); + if (task->head.prev != LIST_POISON2) + list_del(&task->head); free(task); return ctx; @@ -239,7 +240,8 @@ void nuse_event_cancel(struct SimKernel *kernel, void *event) nuse_fiber_stop(g_exported->task_get_private(task->s_task)); /* nuse_fiber_free (task->private); */ - list_del(&task->head); + if (task->head.prev != LIST_POISON2) + list_del(&task->head); } void nuse_task_wait(struct SimKernel *kernel)