avoid unneeded using of per_core macro
This commit is contained in:
parent
452aa3b1d1
commit
40230ade50
1 changed files with 4 additions and 2 deletions
|
@ -83,6 +83,8 @@ inline static int sem_destroy(sem_t* s) {
|
|||
* - -1 on failure
|
||||
*/
|
||||
inline static int sem_wait(sem_t* s) {
|
||||
task_t* curr_task = per_core(current_task);
|
||||
|
||||
if (BUILTIN_EXPECT(!s, 0))
|
||||
return -1;
|
||||
|
||||
|
@ -92,9 +94,9 @@ next_try:
|
|||
s->value--;
|
||||
spinlock_unlock(&s->lock);
|
||||
} else {
|
||||
s->queue[s->pos] = per_core(current_task)->id;
|
||||
s->queue[s->pos] = curr_task->id;
|
||||
s->pos = (s->pos + 1) % MAX_TASKS;
|
||||
block_task(per_core(current_task)->id);
|
||||
block_task(curr_task->id);
|
||||
spinlock_unlock(&s->lock);
|
||||
reschedule();
|
||||
goto next_try;
|
||||
|
|
Loading…
Add table
Reference in a new issue