]> Kevux Git Server - fll/commitdiff
Update: Use bitwise operation check in f_thread_cancel_state_set().
authorKevin Day <kevin@kevux.org>
Thu, 4 Apr 2024 02:37:28 +0000 (21:37 -0500)
committerKevin Day <kevin@kevux.org>
Thu, 4 Apr 2024 02:37:28 +0000 (21:37 -0500)
Also update the comment to make the context of "this" to be more clear.

level_0/f_thread/c/thread.c

index 204f28c79a8655be75b023160d47ba408c50e3e8..8b119c397afabcec65bf150813b768c210fc5296 100644 (file)
@@ -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);