From f842b6fa57859c5898273b5ae9c16499d06963cb Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 22 Apr 2008 21:43:54 +0000 Subject: [PATCH] * Added THREAD_BLOCK_TYPE_OTHER. * Made the object pointer passed to thread_prepare_to_block() const, so that strings can be passed without casting. Passing a string could maybe be made a convention for THREAD_BLOCK_TYPE_OTHER. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25109 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/thread.h | 2 +- headers/private/kernel/thread_types.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/headers/private/kernel/thread.h b/headers/private/kernel/thread.h index 1a93316c77..90dd6d9e90 100644 --- a/headers/private/kernel/thread.h +++ b/headers/private/kernel/thread.h @@ -139,7 +139,7 @@ thread_is_blocked(struct thread* thread) */ static inline void thread_prepare_to_block(struct thread* thread, uint32 flags, uint32 type, - void* object) + const void* object) { thread->wait.flags = flags; thread->wait.type = type; diff --git a/headers/private/kernel/thread_types.h b/headers/private/kernel/thread_types.h index 3f75ae6a87..ac3240e783 100644 --- a/headers/private/kernel/thread_types.h +++ b/headers/private/kernel/thread_types.h @@ -62,6 +62,8 @@ enum { THREAD_BLOCK_TYPE_CONDITION_VARIABLE = 1, THREAD_BLOCK_TYPE_SNOOZE = 2, THREAD_BLOCK_TYPE_SIGNAL = 3, + + THREAD_BLOCK_TYPE_OTHER = 9999, THREAD_BLOCK_TYPE_USER_BASE = 10000 }; @@ -246,7 +248,7 @@ struct thread { status_t status; // current wait status uint32 flags; // interrupable flags uint32 type; // type of the object waited on - void* object; // pointer to the object waited on + const void* object; // pointer to the object waited on timer unblock_timer; // timer for block with timeout } wait;