diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-05 23:22:25 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-09 22:44:22 +0200 |
commit | 66e78ae64bc4659848517953b365606e3e70e878 (patch) | |
tree | ef1339e397feed2b56b8d653d41c03aa5b2bd94f /lib/workqueue.c | |
parent | lib: safely check & set thread pointers (diff) | |
download | frr-66e78ae64bc4659848517953b365606e3e70e878.tar.xz frr-66e78ae64bc4659848517953b365606e3e70e878.zip |
*: update thread_add_* calls
Pass pointer to pointer instead of assigning by return value. See
previous commit message.
To ensure that the behavior stays functionally correct, any assignments
with the result of a thread_add* function have been transformed to set
the pointer to null before passing it. These can be removed wherever the
pointer is known to already be null.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/workqueue.c')
-rw-r--r-- | lib/workqueue.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/workqueue.c b/lib/workqueue.c index 3d481aa89..e997e61b3 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -126,8 +126,9 @@ work_queue_schedule (struct work_queue *wq, unsigned int delay) && (wq->thread == NULL) && (listcount (wq->items) > 0) ) { - wq->thread = thread_add_background(wq->master, work_queue_run, wq, - delay, NULL); + wq->thread = NULL; + thread_add_background(wq->master, work_queue_run, wq, delay, + &wq->thread); /* set thread yield time, if needed */ if (wq->thread && wq->spec.yield != THREAD_YIELD_TIME_SLOT) thread_set_yield_time (wq->thread, wq->spec.yield); |