avoid unneeded using of per_core macro

This commit is contained in:
Stefan Lankes 2011-08-03 21:38:40 +02:00
parent 452aa3b1d1
commit 40230ade50

View file

@ -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;