summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorWenchao Hao <haowenchao@huawei.com>2022-02-02 12:13:16 +0800
committerWenchao Hao <haowenchao@huawei.com>2022-02-08 15:50:15 +0800
commit0b9675a2263174060b11e459fcfd554b10f9ca1e (patch)
tree335ac4ec6b46d57258f794781d401a93922a1719 /usr
parent1ae939da124a44ee23690c8e6b76df777d98e8aa (diff)
downloadopen-iscsi-0b9675a2263174060b11e459fcfd554b10f9ca1e.tar.gz
actor: enhanced: print error log when init a initilized thread
This is only a enhance, do not change origin logic Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
Diffstat (limited to 'usr')
-rw-r--r--usr/actor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr/actor.c b/usr/actor.c
index dc008a7..a6bb02f 100644
--- a/usr/actor.c
+++ b/usr/actor.c
@@ -45,6 +45,10 @@ actor_time_left(actor_t *thread, time_t current_time)
void
__actor_init(actor_t *thread, void (*callback)(void *), void *data)
{
+ if (thread->state != ACTOR_INVALID)
+ log_error("bug:thread %p:%s has already been initialized",
+ thread, thread->name);
+
INIT_LIST_HEAD(&thread->list);
thread->state = ACTOR_NOTSCHEDULED;
thread->callback = callback;