From c84efaa61bdb87fd7e601e11047a000314480274 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 3 Apr 2024 21:38:32 -0500 Subject: [PATCH] Update: Use bitwise operation check in f_thread_cancel_state_set(). Also update the comment to make the context of "this" to be more clear. --- level_0/f_thread/c/thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/level_0/f_thread/c/thread.c b/level_0/f_thread/c/thread.c index 2369046..c9344ef 100644 --- a/level_0/f_thread/c/thread.c +++ b/level_0/f_thread/c/thread.c @@ -614,8 +614,8 @@ extern "C" { int error = 0; - // POSIX doesn't allow this to be NULL, so make POSIX happy. - if (previous == 0) { + // POSIX doesn't allow "previous" to be NULL, so make POSIX happy. + if (!previous) { int ignore = 0; error = pthread_setcancelstate(state, &ignore); -- 1.8.3.1