mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 06:00:02 +08:00
Modifed sleep queue to be priority based and added the wakeup_one method.
This commit is contained in:
parent
f59bd572ec
commit
e9578468aa
@ -71,7 +71,7 @@ sleepinit(void)
|
|||||||
*/
|
*/
|
||||||
_Thread_queue_Initialize(
|
_Thread_queue_Initialize(
|
||||||
&sleep_queue[ii].queue,
|
&sleep_queue[ii].queue,
|
||||||
THREAD_QUEUE_DISCIPLINE_FIFO,
|
THREAD_QUEUE_DISCIPLINE_PRIORITY,
|
||||||
STATES_WAITING_FOR_SLEEP | STATES_INTERRUPTIBLE_BY_SIGNAL,
|
STATES_WAITING_FOR_SLEEP | STATES_INTERRUPTIBLE_BY_SIGNAL,
|
||||||
EAGAIN
|
EAGAIN
|
||||||
);
|
);
|
||||||
@ -273,3 +273,24 @@ wakeup(void *ident)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make a thread sleeping on the specified identifier runnable.
|
||||||
|
* May wake more than one thread if a target thread is currently
|
||||||
|
* swapped out.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
wakeup_one(void *ident)
|
||||||
|
{
|
||||||
|
sleep_queue_control_t *sq;
|
||||||
|
Thread_Control *the_thread;
|
||||||
|
|
||||||
|
sq = sleep_queue_lookup( ident );
|
||||||
|
if (sq == NULL)
|
||||||
|
{
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
the_thread = _Thread_queue_Dequeue(&sq->queue);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user