linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* WaitQueues.
@ 2001-02-13 15:13 Ralph Blach
  2001-02-13 16:22 ` WaitQueues Roland Dreier
  0 siblings, 1 reply; 3+ messages in thread
From: Ralph Blach @ 2001-02-13 15:13 UTC (permalink / raw)
  To: Embedded Linux list

[-- Attachment #1: Type: text/plain, Size: 262 bytes --]

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

[-- Attachment #2: Card for Ralph Blach --]
[-- Type: text/x-vcard, Size: 247 bytes --]

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:rcblach@raleigh.ibm.com
x-mozilla-cpt:;15936
fn:Ralph Blach
end:vcard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: WaitQueues.
  2001-02-13 15:13 WaitQueues Ralph Blach
@ 2001-02-13 16:22 ` Roland Dreier
  0 siblings, 0 replies; 3+ messages in thread
From: Roland Dreier @ 2001-02-13 16:22 UTC (permalink / raw)
  To: Ralph Blach; +Cc: Embedded Linux list


    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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: WaitQueues.
@ 2001-02-14 10:56 Ian Abbott
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Abbott @ 2001-02-14 10:56 UTC (permalink / raw)
  To: Embedded Linux list


On Tuesday, February 13, 2001 3:13 PM, Ralph Blach wrote:

> 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?

Can't you just initialize it on driver startup or via a C initialiser
(for a statically allocated wait queue) or when you create it (for a
dynamically allocated wait queue)?

Look in <asm/atomic.h> for atomic operations.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-02-14 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-13 15:13 WaitQueues Ralph Blach
2001-02-13 16:22 ` WaitQueues Roland Dreier
  -- strict thread matches above, loose matches on Subject: below --
2001-02-14 10:56 WaitQueues Ian Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).