skiplang / skip

A programming language to skip the things you have already computed
http://skiplang.com
MIT License
1.97k stars 66 forks source link

Replaced folly baton with a condition variable. #149

Closed pikatchu closed 4 years ago

pikatchu commented 4 years ago

A folly baton is like a condition variable but that is only used once. Quote from the header in folly:

A Baton allows a thread to block once and be awoken. Captures a single handoff, and during its lifecycle (from construction/reset to destruction/reset) a baton must either be post()ed and wait()ed exactly once each, or not at all.

The thing is, we called reset every time the signal was received, so we were effectively using the baton like a normal condition variable.