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, #make_false, #make_true, #set, #set?, #store, #swap, #toggle, #unset, #unset?, #value, #value=, #wait_until, #wait_until_changed, #wait_until_match, #wait_until_set, #wait_until_unset, #wait_until_value, #wait_while, #wait_while_match, #wait_while_value
Methods included from Internal::ValueSerialization
#as_extended_json, #as_json, #to_bson, #to_bson_normalized_value, #to_cbor, #to_json, #to_msgpack