Документ взят из кэша поисковой машины. Адрес оригинального документа : 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
Кодировка:

Поисковые слова: запрещенные спектральные линии
wrong functions The HyperNews Linux KHG Discussion Pages

Idea: wrong functions

Forum: The Linux Kernel Hackers' Guide
Re: Question interruptible_sleep_on() too slow! (Bill Blackwell)
Keywords: device driver interrupts interruptible_sleep_on()
Date: Fri, 31 Oct 1997 13:39:12 GMT
From: Michael K. Johnson <johnsonm@redhat.com>

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.