tc39 / proposal-atomics-wait-async

"asynchronous atomic wait" for ECMAScript
https://tc39.github.io/proposal-atomics-wait-async/
Other
90 stars 18 forks source link

AddAlarm should call CancelAlarm, not remove the alarm from the set directly #10

Closed lars-t-hansen closed 5 years ago

lars-t-hansen commented 5 years ago

I think that CancelAlarm should return true if the alarm value was in the alarm set (and it thus subsequently tried to remove it) and false otherwise, and that the code in 1.9 AddAlarm should be slightly refactored to read

if CancelAlarm(...) then
  Perform ! Call(alarmFn, ...)

This is only for readability: it means that alarms are always removed by CancelAlarm.