Re: PATCH: (as177) Add class_device_unregister_wait() and platform_device_unregister_wait() to the driver model core

From: Valdis . Kletnieks
Date: Mon Jan 26 2004 - 00:23:39 EST


On Mon, 26 Jan 2004 15:06:48 +1000, Steve Youngs <sryoungs@xxxxxxxxxxxxxx> 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?

And how does the second one know it IS safe to clean up?

Attachment: pgp00000.pgp
Description: PGP signature