Skip to contentSkip to conversation

WaitQueues.

DISCUSSION Ralph Blach 2 participants 2 messages Feb 13, 2001

lore
Share & tools
lore
#0 lore raw

Is there anyway to contionally initialize a wait queue. I want to test a wait queue to see if has been initialized not initialize it. If not, how do I serialize an access to a set location so that I can atomically test and increment that location?

Thanks

Chip

begin:vcard
n:Blach;Ralph
tel;work:919-543-1207
x-mozilla-html:TRUE
url:www.ibm.com
org:IBM MicroElectronics
adr:;;3039 Cornwallis ;RTP;NC;27709;USA
version:2.1
email;internet:[email protected]
x-mozilla-cpt:;15936
fn:Ralph Blach
end:vcard

#1 lore raw

Ralph> Is there anyway to contionally initialize a wait queue. I Ralph> want to test a wait queue to see if has been initialized Ralph> not initialize it. If not, how do I serialize an access to Ralph> a set location so that I can atomically test and increment Ralph> that location?

I'm not sure about doing init_waitqueue_head() conditionally, but as for atomic test and increment, you could use atomic_t (look at asm/atomic.h). That gives you atomic_inc_and_test_greater_zero() among other things. If you just want to set a flag, test_and_set_bit() may be simpler.

Roland

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/