sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
SonicPi::RuntimeMethods#wait_for_parent_thread!
Synchronise on the promise. This means that we block this new thread until we're absolutly sure it's been registered with the parent thread as a thread local var. If the promise isn't delivered within 10s, we assume the parent thread has been killed so we abort running this thread.
Edit
git clone [email protected]:sonic-pi-net/sonic-pi.git
cd sonic-pi
open app/server/ruby/lib/sonicpi/runtime.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-SonicPi--RuntimeMethods-wait_for_parent_thread--for-pr
# Commit to gitgit add app/server/ruby/lib/sonicpi/runtime.rbgit commit -m "better docs for SonicPi::RuntimeMethods#wait_for_parent_thread!"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-SonicPi--RuntimeMethods-wait_for_parent_thread--for-pr
hub pull-request
# Celebrate!