Difference between revisions of "MC-Basic:SEMAPHORESTATE"

From SoftMC-Wiki
Jump to: navigation, search
m (1 revision)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Languages|MC-Basic:SEMAPHORESTATE}}
 
{{MC-Basic
 
{{MC-Basic
 
|SHORT FORM=
 
|SHORT FORM=
Line 7: Line 8:
  
 
|AVAILABILITY=
 
|AVAILABILITY=
Versions 3.7.x and higher
+
Since Version 3.7.x
  
 
|DESCRIPTION=
 
|DESCRIPTION=
Line 58: Line 59:
  
 
|SEE ALSO=
 
|SEE ALSO=
* [[Axystems:MC-Basic:SEMAPHORETAKE|SEMAPHORETAKE]]
+
* [[MC-Basic:SEMAPHORETAKE|SEMAPHORETAKE]]
* [[Axystems:MC-Basic:SEMAPHOREGIVE|SEMAPHOREGIVE]]
+
* [[MC-Basic:SEMAPHOREGIVE|SEMAPHOREGIVE]]
 
 
  
 +
[[Category:MC-Basic:Semaphore Handling|SEMAPHORESTATE]]
 
}}
 
}}

Latest revision as of 03:09, 28 April 2017

Language: English  • 中文(简体)‎

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

Since Version 3.7.x

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