sched_wakeup_thread(): memory barrier after status update
This commit is contained in:
@ -677,6 +677,7 @@ static uint64_t futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q
|
|||||||
* access to the hash list and forcing another memory barrier.
|
* access to the hash list and forcing another memory barrier.
|
||||||
*/
|
*/
|
||||||
xchg4(&(cpu_local_var(current)->status), PS_INTERRUPTIBLE);
|
xchg4(&(cpu_local_var(current)->status), PS_INTERRUPTIBLE);
|
||||||
|
barrier();
|
||||||
queue_me(q, hb);
|
queue_me(q, hb);
|
||||||
|
|
||||||
if (!plist_node_empty(&q->list)) {
|
if (!plist_node_empty(&q->list)) {
|
||||||
|
|||||||
@ -2861,6 +2861,7 @@ sched_wakeup_thread(struct thread *thread, int valid_states)
|
|||||||
proc->status = PS_RUNNING;
|
proc->status = PS_RUNNING;
|
||||||
mcs_rwlock_writer_unlock_noirq(&proc->update_lock, &updatelock);
|
mcs_rwlock_writer_unlock_noirq(&proc->update_lock, &updatelock);
|
||||||
xchg4((int *)(&thread->status), PS_RUNNING);
|
xchg4((int *)(&thread->status), PS_RUNNING);
|
||||||
|
barrier();
|
||||||
status = 0;
|
status = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user