Changes between Version 3 and Version 4 of Challenge
- Timestamp:
- 03/11/19 16:03:50 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Challenge
v3 v4 8 8 Be sure to include the appropriate headers. 9 9 10 11 12 Semaphore operations: 13 * V(s) = `s++` 14 * P(s) = `$when (s>0) s--` 15 You could define them as functions, or as preprocessor macros 16 (`#define` ...) 17 10 `$when (expr) stmt`:: a guarded command. Blocks until `expr` 11 is true. Executes the first atomic action of `stmt` atomically 12 with the evaluation of `expr` to true. Example: `$when (s>0) s--` 13 defines Dijkstra's P operation on semaphores. The V operation 14 is just s++. Note that s-- and s++ are both atomic in CIVL-C. 18 15 19 16 `_Bool`:: The Boolean type. Values: 0 and 1. This is the same as C11.
