MC-Basic:SEMAPHORESTATE

From SoftMC-Wiki
Revision as of 16:01, 13 December 2010 by Arwiebe (talk | contribs) (Created page with '{{MC-Basic |SHORT FORM= semstate |SYNTAX= ?semstate(<''semaphore name''>) |AVAILABILITY= Versions 3.7.x and higher |DESCRIPTION= SEMSTATE returns the semaphore status : 1 , if…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

SEMSTATE returns the semaphore status : 1 , if  the semaphore is taken before (busy) or  0 , if the semaphore is released .

Works for Global user-semaphores , Structure-element semaphores , the  semaphores passed by-reference (within a function \ sub block).

Short form

semstate

Syntax

?semstate(<semaphore name>)

Availability

Versions 3.7.x and higher

Range

0 , 1

Scope

Task, Terminal

Limitations

A semaphore passed by-reference (within a function \ sub block).

Examples

-->common shared sem1 as semaphore

-->?SemState(sem1)

-->0

-->?SemTake(sem1)

-->1

-->?semstate(sem1)

-->1

-->?SemState(sem1)

-->1

-->SemGive(sem1)

-->?SemState(sem1)

-->0

See Also