sleep_on - synchronization using a condition variable
struct wait_queue*con = 0;
While a process is sleeping, it is fully interruptible, no matter what the cpu state when entering the function. The cpu state is restored on being awakened.
If a null(0) is passed to sleep_on, it returns immediately, without sleeping. This is a no-op.
The sleep_on function cannot be called by interrupt handlers.
The function is not atomic with the condition tests that the driver writer might include, so the code executing the sleep_on function is protected from interrupts. Failure to do so generally leads to race conditions.
Закладки на сайте
Проследить за страницей
Created 1996-2021 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру