Skip to content

Commit c6dcb9a

Browse files
committed
slightly better doctests for islocked
1 parent 54f5fb3 commit c6dcb9a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/resources/containers.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ isready(c::Container) = c.level > 0
7777
Returns `true` if the store is full, similarly to the meaning of `islocked` for `Base.ReentrantLock`.
7878
7979
```jldoctest
80-
julia> sim = Simulation(); res = Resource(sim); islocked(res)
80+
julia> sim = Simulation(); res = Resource(sim, 2); islocked(res)
81+
false
82+
83+
julia> request(res); islocked(res)
8184
false
8285
8386
julia> request(res); islocked(res)

src/resources/stores.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,13 @@ isready(sto::Store) = sto.load > 0
8888
Returns `true` if the store is full, similarly to the meaning of `islocked` for `Base.ReentrantLock`.
8989
9090
```jldoctest
91-
julia> sim = Simulation(); store = Store{Symbol}(sim; capacity=1); islocked(store)
91+
julia> sim = Simulation(); store = Store{Symbol}(sim; capacity=2); islocked(store)
9292
false
9393
9494
julia> put!(store, :message); islocked(store)
95+
false
96+
97+
julia> put!(store, :another_message); islocked(store)
9598
true
9699
```
97100
"""

0 commit comments

Comments
 (0)