Skip to content

Commit 45ba7b4

Browse files
committed
Small improvements
1 parent 4b028fe commit 45ba7b4

File tree

1 file changed

+5
-5
lines changed
  • content/courses/ada-in-practice/chapters

1 file changed

+5
-5
lines changed

content/courses/ada-in-practice/chapters/raii.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ In order for the expected semantics to be obtained, some types require clients
1212
to follow a specific protocol when calling the type's operations. Furthermore,
1313
failing to follow the protocol can cause system-wide ill effects.
1414

15-
For example, in the context of competing concurrent threads accessing shared
16-
resources, concurrency abstractions such as mutexes provide the mutually
17-
exclusive access necessary to prevent race conditions. These mutex objects must
15+
For example, concurrency abstractions such as mutexes provide the mutually
16+
exclusive access necessary to prevent the race conditions that arise when
17+
competing concurrent threads access shared resources. These mutex objects must
1818
be 1) both acquired and released, 2) by every thread accessing that shared
1919
resource, 3) at the right places in the source code, and 4) in the proper
2020
order. Failure to acquire the mutex prior to accessing the shared resource
@@ -325,7 +325,7 @@ that the type will be controlled because we don't intend :ada:`Initialize` and
325325
326326
No additional record components are required, beyond the access discriminant.
327327

328-
Immediately following the type declaration, we declare overridden versions of
328+
Immediately following the type declaration, we declare overriding versions of
329329
the inherited procedures :ada:`Initialize` and :ada:`Finalize`:
330330

331331
.. code-block:: ada
@@ -444,7 +444,7 @@ Cons
444444

445445
The lock is global, so all calls go through it. Hence all calls are sequential,
446446
even if some could run concurrently. In the above example that's exactly as
447-
required, but in other situations it might be too limiting.
447+
required, but in other situations it might be unnecessarily limiting.
448448

449449
Compared to the manual call approach, the run-time cost for keeping track of
450450
objects to be finalized could be non-trivial. That's likely true in any

0 commit comments

Comments
 (0)