Class: Farce::Flag
- Inherits:
-
Internal::Flag
- Object
- Internal::Flag
- Farce::Flag
- Includes:
- Abstract::Flag, Shareable::Native
- Defined in:
- lib/farce/flag.rb
Overview
A Ractor-shareable atomic boolean for coordinating threads and Ractors. Only true and false are accepted. Read Abstract::Flag#value when testing the flag's state. Use Abstract::Flag#compare_and_set to check and change the state in a single atomic operation.
On CRuby, subclasses must not add Ruby instance variables.
Instance Method Summary collapse
- #initialize(value = false) ⇒ BasicObject constructor
Methods included from Shareable
Methods included from Abstract::Flag
#compare_and_set, #set, #store, #swap, #toggle, #unset, #value, #value=
Methods included from Internal::ValueSerialization
#as_extended_json, #as_json, #to_bson, #to_bson_normalized_value, #to_cbor, #to_json, #to_msgpack