From 4d2f5402bd28b1f380fa206bd4b000454c4d794d Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 3 Apr 2024 21:37:28 -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 204f28c..8b119c3 100644 --- a/level_0/f_thread/c/thread.c +++ b/level_0/f_thread/c/thread.c @@ -604,8 +604,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