Models have `incr_<SEM>` and `<SEM>_set?` to interact with semaphores. Progs also have `incr_<SEM>`, `decr_<SEM>`, and `when_<SEM>_set?` to interact with semaphores. The `when_<SEM>_set?` method accepts a block and executes it when the semaphore is set, so we can't negate the condition. Additionally, it doesn't offer much advantage over `<SEM>_set?`. Having two different interfaces makes things more complex, so we might consider removing `when_<SEM>_set?`. As a first step, I added a `<SEM>_set?` helper to the base prog. I used it to check for the absence of the destroying semaphore instead of checking via its subject. Since we have the `incr` method on both the prog and model, we can also have the `set?` method on both.
14 KiB
14 KiB