Created
January 16, 2013 18:37
-
-
Save Sgeo/4549582 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
waitFor: anAnnouncementClass | |
"Blocks the current process until anAnnouncementClass is announced. | |
Note that synchronous code using this method runs the risk of missing announcements." | |
| val sem | | |
sem := Semaphore new. | |
self on: anAnnouncementClass do: [:ann | val := ann. sem signal]. | |
sem wait. | |
^val. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment