Removed an XXX comment question, and replaced it with an explanation of the
issue. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2363 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
831e32af8c
commit
d703e5451d
@ -47,8 +47,12 @@ dump_run_q(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Enqueues the thread to the run queue.
|
||||||
|
* Note: THREAD_LOCK must be held when entering this function
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
thread_enqueue_run_q(struct thread *t) //XXX no locks? is this save?
|
thread_enqueue_run_q(struct thread *t)
|
||||||
{
|
{
|
||||||
struct thread *curr, *prev;
|
struct thread *curr, *prev;
|
||||||
|
|
||||||
@ -93,7 +97,10 @@ thread_set_priority(thread_id id, int32 priority)
|
|||||||
if (t->id == id) {
|
if (t->id == id) {
|
||||||
// it's ourself, so we know we aren't in the run queue, and we can manipulate
|
// it's ourself, so we know we aren't in the run queue, and we can manipulate
|
||||||
// our structure directly
|
// our structure directly
|
||||||
retval = t->priority; //XXX is this really save? can't we get preempted right here?
|
retval = t->priority;
|
||||||
|
// note that this might not return the correct value if we are preempted
|
||||||
|
// here, and another thread changes our priority before the next line is
|
||||||
|
// executed
|
||||||
t->priority = priority;
|
t->priority = priority;
|
||||||
} else {
|
} else {
|
||||||
int state = disable_interrupts();
|
int state = disable_interrupts();
|
||||||
|
Loading…
Reference in New Issue
Block a user