-
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
09-threads.md - add basic mutex and waiting demonstration
Add a basic example extending the existing one: * Uses the same sleepy function * Adds a global integer counter * Adds use of a mutex example * Adds use of a wait group and thread pool for waiting for completions * Uses defer on mutex and waitgroup as good practice demonstration Issues * uses a `sleep()` to avoid reaching the `waitAndWork(&wg)` too soon. Feels like a hack, but not sure what else to do. Tested with * `0.13.0` * `0.14.0-dev.2441+3670910f2`
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
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