-spec set_barrier(barrier_id(),
classy:run_level(), [Option]) -> ok |
{error,
deleted |
badarg} when Option ::
monitor |
async |
{hint,
description()}.
This function does the following:
ok to the caller.
classy_boot:rm_barrier/1 is called with the same lock ID.
If async option is present,
the function returns immediately without waiting for the level to be adjusted.
If monitor option is present,
the barrier is automatically removed when the process that set it terminates.
{hint, Hint} option allows to attach an arbitrary term
serving as a hint to the operator explaining what the boot is waiting for.
If the barrier with the same ID already existed, its level and description are updated.
WARNING: with an exception of monitor option,
business logic is entirely responsible for removing the barriers.