@@ -366,7 +366,7 @@ may be found [here](./PRIMITIVES.md).
366
366
367
367
## 3.1 Lock
368
368
369
- This describes the use of the official ` Lock ` primitive.
369
+ This describes the use of the official ` Lock ` primitive. [ Full details. ] ( ./PRIMITIVES.md#32-class-lock )
370
370
371
371
This guarantees unique access to a shared resource. In the following code
372
372
sample a ` Lock ` instance ` lock ` has been created and is passed to all coros
@@ -416,7 +416,7 @@ is significantly less efficient than the official class.
416
416
This provides a way for one or more coros to pause until another flags them to
417
417
continue. An ` Event ` object is instantiated and made accessible to all coros
418
418
using it. Coros waiting on the event issue ` await event ` whereupon execution
419
- pauses until another issues ` event.set() ` .
419
+ pauses until another issues ` event.set() ` . [ Full details. ] ( ./PRIMITIVES.md#33-class-event )
420
420
421
421
This presents a problem if ` event.set() ` is issued in a looping construct; the
422
422
code must wait until the event has been accessed by all waiting coros before
@@ -476,7 +476,7 @@ This enables multiple coros to rendezvous at a particular point. For example
476
476
producer and consumer coros can synchronise at a point where the producer has
477
477
data available and the consumer is ready to use it. At that point in time the
478
478
` Barrier ` can optionally run a callback before releasing the barrier and
479
- allowing all waiting coros to continue.
479
+ allowing all waiting coros to continue. [ Full details. ] ( ./PRIMITIVES.md#34-class-barrier )
480
480
481
481
The callback can be a function or a coro. In most applications a function is
482
482
likely to be used: this can be guaranteed to run to completion before the
@@ -509,6 +509,7 @@ A semaphore limits the number of coros which can access a resource. It can be
509
509
used to limit the number of instances of a particular coro which can run
510
510
concurrently. It performs this using an access counter which is initialised by
511
511
the constructor and decremented each time a coro acquires the semaphore.
512
+ [ Full details.] ( ./PRIMITIVES.md#35-class-semaphore )
512
513
513
514
The easiest way to use it is with a context manager:
514
515
@@ -525,7 +526,7 @@ An example is the `semaphore_test` function in `asyntest.py`.
525
526
526
527
This works identically to the ` Semaphore ` class except that if the ` release `
527
528
method causes the access counter to exceed its initial value, a ` ValueError `
528
- is raised.
529
+ is raised. [ Full details. ] ( ./PRIMITIVES.md#351-class-boundedsemaphore )
529
530
530
531
###### [ Contents] ( ./TUTORIAL.md#contents )
531
532
0 commit comments