author | Mario de Sousa <msousa@fe.up.pt> |
Wed, 01 Feb 2012 19:49:11 +0000 | |
changeset 417 | d48f53715f77 |
parent 251 | 5e7457efbb8f |
permissions | -rw-r--r-- |
251
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
1 |
(* |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
2 |
* (c) 2011 Edouard Tisserant |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
3 |
* |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
4 |
* Fake semaphore support, for non preemptive implementation. |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
5 |
* |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
6 |
*) |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
7 |
|
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
8 |
|
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
9 |
FUNCTION_BLOCK SEMA |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
10 |
VAR_INPUT |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
11 |
CLAIM : BOOL; |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
12 |
RELEASE : BOOL; |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
13 |
END_VAR |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
14 |
VAR_OUTPUT |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
15 |
BUSY : BOOL; |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
16 |
END_VAR |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
17 |
VAR |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
18 |
Q_INTERNAL : BOOL; |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
19 |
END_VAR |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
20 |
|
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
21 |
Q_INTERNAL := CLAIM OR ( Q_INTERNAL AND (NOT RELEASE)); |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
22 |
BUSY := Q_INTERNAL; |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
23 |
|
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
24 |
END_FUNCTION_BLOCK |
5e7457efbb8f
Added dumb SEMA?implementation
Edouqrd Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
25 |