Skip to content

Instantly share code, notes, and snippets.

@bnielsen1965
Created February 14, 2018 21:20
Show Gist options
  • Save bnielsen1965/b12940fa8108a23e2708fe7fc260feed to your computer and use it in GitHub Desktop.
Save bnielsen1965/b12940fa8108a23e2708fe7fc260feed to your computer and use it in GitHub Desktop.
button threads
parent child
request lock on mutex :loop
create child thread request lock on mutex (may be a timeout)
:loop
poll for button change
release lock on mutex
wait on barrier release lock on mutex (if not timeout)
wait on barrier (if not timeout)
request lock on mutex wait on barrier (if not timeout)
wait on barrier process button state based on button change
goto :loop goto :loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment