Sample variables are slightly different from a normal
- Reading an empty
SampleVarcauses the reader to block. (same as
- Reading a filled
SampleVarempties it and returns value. (same as
- Writing to an empty
SampleVarfills it with a value, and potentially, wakes up a blocked reader (same as for
- Writing to a filled
SampleVaroverwrites the current value. (different from
If the SampleVar is full, leave it empty. Otherwise, do nothing.
Wait for a value to become available, then take it and return.
Write a value into the
SampleVar, overwriting any previous value that