Am Mittwoch, 28. April 2004 02:16 schrieb Greg KH:
> On Mon, Apr 19, 2004 at 09:06:50AM +0200, Oliver Neukum wrote:
> > Am Montag, 19. April 2004 04:55 schrieb Alan Stern:
> > > On Sun, 18 Apr 2004, Oliver Neukum wrote:
> > > > Am Sonntag, 18. April 2004 16:36 schrieb Alan Stern:
> > > > > > A spinlock could replace it. But that is a small detail.
> > > > >
> > > > > Yes it could. Then the driver would start to resemble its original
> > > > > form again, defeating Greg's point.
> > > >
> > > > Where's the difference between
> > > > lock_kernel();
> > > > vs.
> > > > spin_lock(&skel_open_lock);
> > >
> > > Ah, but if you use a spinlock (or semaphore) instead of lock_kernel()
> > > then you have to lock _both_ the open() and disconnect() routines.
> > > Otherwise the lock won't do anything useful.
> >
> > That's an advantage. Using the knowledge that sys_open() takes BKL in
> > an example driver is not nice.
>
> But it's a fact of life. We need an external lock (from the internal
> device structure) to prevent race conditions. open() takes the BKL.
> So, let's use that. It's simple, nice, and it works.
Then put in a big fat comment. An example should be as clear as
possible.
Regards
Oliver
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel