* 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
This commit is contained in:
Ingo Weinhold 2008-04-22 21:43:54 +00:00
parent a017bfe8de
commit f842b6fa57
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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;