mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 21:47:15 +02:00
lib: Thread is being used and set at the same time
The call to set thread is being used and set at the same time in various pthreads in the code. This should not be happening. Let's fix it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
4e5c8ddf06
commit
37588948aa
16
lib/event.c
16
lib/event.c
|
@ -1505,13 +1505,7 @@ void event_cancel_async(struct event_loop *master, struct event **thread,
|
|||
{
|
||||
assert(!(thread && eventobj) && (thread || eventobj));
|
||||
|
||||
if (thread && *thread)
|
||||
frrtrace(9, frr_libfrr, event_cancel_async, master,
|
||||
(*thread)->xref->funcname, (*thread)->xref->xref.file,
|
||||
(*thread)->xref->xref.line, NULL, (*thread)->u.fd,
|
||||
(*thread)->u.val, (*thread)->arg,
|
||||
(*thread)->u.sands.tv_sec);
|
||||
else
|
||||
if (!thread)
|
||||
frrtrace(9, frr_libfrr, event_cancel_async, master, NULL, NULL,
|
||||
0, NULL, 0, 0, eventobj, 0);
|
||||
|
||||
|
@ -1521,6 +1515,14 @@ void event_cancel_async(struct event_loop *master, struct event **thread,
|
|||
master->canceled = false;
|
||||
|
||||
if (thread) {
|
||||
if (*thread)
|
||||
frrtrace(9, frr_libfrr, event_cancel_async,
|
||||
master, (*thread)->xref->funcname,
|
||||
(*thread)->xref->xref.file,
|
||||
(*thread)->xref->xref.line, NULL,
|
||||
(*thread)->u.fd, (*thread)->u.val,
|
||||
(*thread)->arg,
|
||||
(*thread)->u.sands.tv_sec);
|
||||
struct cancel_req *cr =
|
||||
XCALLOC(MTYPE_TMP, sizeof(struct cancel_req));
|
||||
cr->threadref = thread;
|
||||
|
|
Loading…
Reference in a new issue