diff options
author | Luiz Brandao <fromvega@gmail.com> | 2022-01-24 10:16:35 -0500 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-02-04 11:20:15 +1100 |
commit | ddda959e57d704873c91be05dec95846b7949c17 (patch) | |
tree | fd1d5db79a40c2c49d17646068eec456e7eadd59 | |
parent | 5943a2ec79e51df91e0bb5d57ead68c57569f5cd (diff) |
docs/reference/isr_rules.rst: Fix inconsistent variable name in example.
Fixed to be conistent with the code example above it.
-rw-r--r-- | docs/reference/isr_rules.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/reference/isr_rules.rst b/docs/reference/isr_rules.rst index 7f466ab42..a611f492a 100644 --- a/docs/reference/isr_rules.rst +++ b/docs/reference/isr_rules.rst @@ -339,8 +339,8 @@ A critical section can comprise a single line of code and a single variable. Con This example illustrates a subtle source of bugs. The line ``count += 1`` in the main loop carries a specific race condition hazard known as a read-modify-write. This is a classic cause of bugs in real time systems. In the main loop -MicroPython reads the value of ``t.counter``, adds 1 to it, and writes it back. On rare occasions the interrupt occurs -after the read and before the write. The interrupt modifies ``t.counter`` but its change is overwritten by the main +MicroPython reads the value of ``count``, adds 1 to it, and writes it back. On rare occasions the interrupt occurs +after the read and before the write. The interrupt modifies ``count`` but its change is overwritten by the main loop when the ISR returns. In a real system this could lead to rare, unpredictable failures. As mentioned above, care should be taken if an instance of a Python built in type is modified in the main code and |