You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
println(name, " starting to charge at ", now(env))
306
306
@yield timeout(sim, charge_duration)
307
307
println(name, " leaving the bcs at ", now(env))
308
-
@yield release(bcs)
308
+
@yield unlock(bcs)
309
309
end
310
310
car (generic function with 1 method)
311
311
```
312
312
313
-
The resource’s `lock` function generates an event that lets you wait until the resource becomes available again. If you are resumed, you “own” the resource until you release it.
313
+
The resource’s `lock` function generates an event that lets you wait until the resource becomes available again. If you are resumed, you “own” the resource until you release it with `unlock`.
314
314
315
-
You are responsible to call `release` once you are done using the resource. When you release a resource, the next waiting process is resumed and now “owns” one of the resource’s slots. The basic `Resource` sorts waiting processes in a FIFO (first in—first out) way.
315
+
You are responsible to call `unlock` once you are done using the resource. When you unlock (release) a resource, the next waiting process is resumed and now “owns” one of the resource’s slots. The basic `Resource` sorts waiting processes in a FIFO (first in—first out) way.
316
316
317
317
A resource needs a reference to an `Environment` and a capacity when it is created:
318
318
@@ -328,7 +328,7 @@ DocTestSetup = quote
328
328
println(name, " starting to charge at ", now(env))
329
329
@yield timeout(sim, charge_duration)
330
330
println(name, " leaving the bcs at ", now(env))
331
-
@yield release(bcs)
331
+
@yield unlock(bcs)
332
332
end
333
333
end
334
334
```
@@ -355,7 +355,7 @@ DocTestSetup = quote
355
355
println(name, " starting to charge at ", now(env))
356
356
@yield timeout(sim, charge_duration)
357
357
println(name, " leaving the bcs at ", now(env))
358
-
@yield release(bcs)
358
+
@yield unlock(bcs)
359
359
end
360
360
361
361
sim = Simulation()
@@ -397,7 +397,7 @@ DocTestSetup = quote
397
397
println(name, " starting to charge at ", now(env))
0 commit comments