Skip to content

Commit

Permalink
lib: Thread is being used and set at the same time
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
donaldsharp committed May 24, 2024
1 parent 3fe2ab0 commit 3ec469c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1531,13 +1531,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);

Expand All @@ -1547,6 +1541,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;
Expand Down

0 comments on commit 3ec469c

Please sign in to comment.