From 17e41f525173c8ee4728e17ea499c1bc9c3dafa5 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 25 Feb 2005 14:10:41 +0000 Subject: [PATCH] Added new semaphore flag B_KILL_CAN_INTERRUPT. It makes acquire_sem_etc() interruptable by SIGKILL[THR], even if B_CAN_INTERRUPT is not set. Not sure, if this is the best solution, but it works. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11484 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/kernel/OS.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/headers/os/kernel/OS.h b/headers/os/kernel/OS.h index 7c4b41ebad..b738d747b9 100644 --- a/headers/os/kernel/OS.h +++ b/headers/os/kernel/OS.h @@ -147,13 +147,21 @@ typedef struct sem_info { /* semaphore flags */ enum { - B_CAN_INTERRUPT = 1, /* acquisition of the semaphore can be interrupted (system use only) */ - B_CHECK_PERMISSION = 4, /* ownership will be checked (system use only) */ + B_CAN_INTERRUPT = 0x01, // acquisition of the semaphore can be + // interrupted (system use only) + B_CHECK_PERMISSION = 0x04, // ownership will be checked (system use + // only) + B_KILL_CAN_INTERRUPT = 0x20, // acquisition of the semaphore can be + // interrupted by SIGKILL[THR], even + // if not B_CAN_INTERRUPT (system use + // only) /* release_sem_etc() only flags */ - B_DO_NOT_RESCHEDULE = 2, /* thread is not rescheduled */ - B_RELEASE_ALL = 8, /* all waiting threads will be woken up, count will be zeroed */ - B_RELEASE_IF_WAITING_ONLY = 16, /* release count only if there are any threads waiting */ + B_DO_NOT_RESCHEDULE = 0x02, // thread is not rescheduled + B_RELEASE_ALL = 0x08, // all waiting threads will be woken up, + // count will be zeroed + B_RELEASE_IF_WAITING_ONLY = 0x10, // release count only if there are any + // threads waiting }; extern sem_id create_sem(int32 count, const char *name);