lkml.org 
[lkml]   [2004]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: PATCH: (as177) Add class_device_unregister_wait() and platform_device_unregister_wait() to the driver model core
From
Date
* Valdis Kletnieks <Valdis.Kletnieks@vt.edu> writes:

> On Mon, 26 Jan 2004 15:06:48 +1000, Steve Youngs <sryoungs@bigpond.net.au> said:
>> > A boolean is just a one-bit reference count. If the maximum number of
>> > simultaneous 'users' for a given module is one, then a boolean will work.
>> > If there is potential for more than one simultaneous user then you need
>> > more bits.
>>
>> Why? A module is either being used or it isn't, the number of uses
>> shouldn't even come into it.
> OK. There's 2 users of the module. The first one exits. How does
> it (or anything else) know that it's NOT safe to just clear the
> in-use bit and clean it up?
Because the 2nd user is still using the module so its in-use bit
should still be set. Remember that when the module was first loaded
it registered a function with the kernel for testing whether the
module is in use.

I must be overlooking something because I see the answer so clearly.
Maybe if someone could give me a real world example of a situation
where it'd be hard/impossible/unsafe to unload a module and I'll see
if my ideas can be applied.



--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| Ashes to ashes, dust to dust. |
| The proof of the pudding, is under the crust. |
|------------------------------<sryoungs@bigpond.net.au>---|
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:00    [from the cache]
©2003-2011 Jasper Spaans