ECMAScript® 2024 Language Specification

Draft ECMA-262 / February 15, 2024

29.8 Races

For an execution execution, two events E and D in SharedDataBlockEventSet(execution) are in a race if the following algorithm returns true.

  1. If E is not D, then
    1. If the pairs (E, D) and (D, E) are not in execution.[[HappensBefore]], then
      1. If E and D are both WriteSharedMemory or ReadModifyWriteSharedMemory events and E and D do not have disjoint ranges, then
        1. Return true.
      2. If execution.[[ReadsFrom]] contains either (E, D) or (D, E), then
        1. Return true.
  2. Return false.