mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
add check in spinlocks if another task is ready
This commit is contained in:
parent
0527084f7f
commit
8047f898e2
1 changed files with 5 additions and 2 deletions
|
@ -38,6 +38,7 @@
|
|||
#include <hermit/spinlock_types.h>
|
||||
#include <hermit/tasks_types.h>
|
||||
#include <hermit/errno.h>
|
||||
#include <hermit/tasks.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/irqflags.h>
|
||||
|
@ -103,7 +104,8 @@ inline static int spinlock_lock(spinlock_t* s) {
|
|||
#if 1
|
||||
ticket = atomic_int32_inc(&s->queue);
|
||||
while(atomic_int32_read(&s->dequeue) != ticket) {
|
||||
PAUSE;
|
||||
//PAUSE;
|
||||
check_scheduling();
|
||||
}
|
||||
s->owner = curr_task->id;
|
||||
s->counter = 1;
|
||||
|
@ -193,7 +195,8 @@ inline static int spinlock_irqsave_lock(spinlock_irqsave_t* s) {
|
|||
|
||||
ticket = atomic_int32_inc(&s->queue);
|
||||
while (atomic_int32_read(&s->dequeue) != ticket) {
|
||||
PAUSE;
|
||||
//PAUSE;
|
||||
check_scheduling();
|
||||
}
|
||||
|
||||
s->coreid = CORE_ID;
|
||||
|
|
Loading…
Add table
Reference in a new issue