From 024113b90eb00a7df5971e0f79d9a18ba722c57a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 28 Aug 2017 13:03:53 -0600 Subject: [PATCH] Work queues... correct cloning error in last commit --- libc/wqueue/work_queue.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libc/wqueue/work_queue.c b/libc/wqueue/work_queue.c index fbf166a0e4..3a09c6d389 100644 --- a/libc/wqueue/work_queue.c +++ b/libc/wqueue/work_queue.c @@ -91,10 +91,6 @@ static int work_qqueue(FAR struct usr_wqueue_s *wqueue, { DEBUGASSERT(work != NULL); - /* Cancel any pending work in the work stucture */ - - work_cancel(qid, work); - /* Get exclusive access to the work queue */ while (work_lock() < 0); @@ -154,6 +150,10 @@ int work_queue(int qid, FAR struct work_s *work, worker_t worker, { if (qid == USRWORK) { + /* Cancel any pending work in the work stucture */ + + work_cancel(qid, work); + return work_qqueue(&g_usrwork, work, worker, arg, delay); } else