while (!atomic_load(&sem->counter)) {
schedule();
}
atomic_fetch_sub(&sem->counter, 1);
}
while (!atomic_load(&sem->counter)) {
schedule();
}
atomic_fetch_sub(&sem->counter, 1);
}
atomic_fetch_add(&sem->counter, 1);
// TODO: wake up a thread
}
\ No newline at end of file
atomic_fetch_add(&sem->counter, 1);
// TODO: wake up a thread
}
\ No newline at end of file