Changes between Version 3 and Version 4 of Challenge


Ignore:
Timestamp:
03/11/19 16:03:50 (7 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Challenge

    v3 v4  
    88Be sure to include the appropriate headers.
    99
    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.
    1815
    1916 `_Bool`::  The Boolean type.  Values: 0 and 1.  This is the same as C11.