what's this mean .count = ATOMIC_INIT(n), ?

B

baumann@pan

hi all,

while i am reading the linux codes, i found lot as below

#define __SEMAPHORE_INITIALIZER(name, n) \
{ \
.count = ATOMIC_INIT(n), \
.waking = ATOMIC_INIT(0), \
.wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
}

i never see .count, .walking, .wait usage in ms windows 's source code.

is it linux gcc specific? or c99 has defined its usage?
 
P

Prawit Chaivong

baumann@pan said:
hi all,

while i am reading the linux codes, i found lot as below

#define __SEMAPHORE_INITIALIZER(name, n) \
{ \
.count = ATOMIC_INIT(n), \
.waking = ATOMIC_INIT(0), \
.wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
}

i never see .count, .walking, .wait usage in ms windows 's source code.

is it linux gcc specific? or c99 has defined its usage?

This is macro, I'd have thought that this would be an assembly
language.
And this macro would be used in inline-assembly part.

Just guess.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top