[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [bluetooth-dev] SDP problem...



> > > >       cli();
> > > >       if (database_query.count <= 0) {
> > > >               D_PROC(__FUNCTION__ " No bytes available, going to sleep\n");
> > > >               interruptible_sleep_on(&database_wq);
> > > >       }
> > > >       sti();
> > >  
> > > > So when sdp_server tries to read the sdp_proc file, all 
> > > > interrupts are disabled, and then it goes to sleep right?
> > > > So, no more interrupts can happen. I don't understand
> > > > this piece of code (I'm sorry).

The above has nothing explicitely to do with interrupts on/off or even
whether interruptible_sleep_on fiddles with the interrupt status really

This is obvious because you cannot task-switch with interrupts off anyway,
so the cli/sti pair is most probably aimed at providing an atomic way of
only sleeping if .count <= 0. But you can do this in better ways, by
manually adding yourself to the task queues, and you don't have to
disable/enable irq's at all. Races between sleepers and awakers is the
bread and butter of the driver writer :) 

Max is right in that "interruptible" in sleep_on has nothing to do with
hardware interrupts but instead has to do with software interrupts
(signals)

/BW

-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com