Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.arcetri.astro.it/irlab/doc/library/linux/khg/HyperNews/get/khg/140/1.html
Дата изменения: Thu Mar 23 12:37:42 2000 Дата индексирования: Wed Sep 15 04:08:10 2010 Кодировка: Поисковые слова: запрещенные спектральные линии |
Getting around this common race condition without disabling
interrupts is one of Linux's features.
You need to add the function to the wait queue before you write to the board and cause the interrupt to occur. Look at kernel/sched.c at the definition of interruptible_sleep_on(): You want to do something like this: current->state = TASK_INTERRUPTIBLE; add_wait_queue(this_entry, &wait); trigger_interrupt_from_board(); schedule(); remove_wait_queue(this_entry, &wait);Linux's serial.c uses this trick. |