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
This commit is contained in:
+13
-5
@@ -147,13 +147,21 @@ typedef struct sem_info {
|
|||||||
|
|
||||||
/* semaphore flags */
|
/* semaphore flags */
|
||||||
enum {
|
enum {
|
||||||
B_CAN_INTERRUPT = 1, /* acquisition of the semaphore can be interrupted (system use only) */
|
B_CAN_INTERRUPT = 0x01, // acquisition of the semaphore can be
|
||||||
B_CHECK_PERMISSION = 4, /* ownership will be checked (system use only) */
|
// 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 */
|
/* release_sem_etc() only flags */
|
||||||
B_DO_NOT_RESCHEDULE = 2, /* thread is not rescheduled */
|
B_DO_NOT_RESCHEDULE = 0x02, // thread is not rescheduled
|
||||||
B_RELEASE_ALL = 8, /* all waiting threads will be woken up, count will be zeroed */
|
B_RELEASE_ALL = 0x08, // all waiting threads will be woken up,
|
||||||
B_RELEASE_IF_WAITING_ONLY = 16, /* release count only if there are any threads waiting */
|
// 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);
|
extern sem_id create_sem(int32 count, const char *name);
|
||||||
|
|||||||
Reference in New Issue
Block a user