diff options
author | Murray Cumming <murrayc@murrayc.com> | 2011-10-26 22:27:48 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2011-10-26 22:27:48 +0200 |
commit | acf84955b9a86597e4675a0edc0848851ecafba7 (patch) | |
tree | 9e029994b833936ffbf5c113d8a1cfa972465095 /examples | |
parent | 2137668ccdad1a908d3ed275b2cf2eee8afb94cb (diff) | |
download | glibmm-acf84955b9a86597e4675a0edc0848851ecafba7.tar.gz |
threadpool example: Use Mutex instead of StaticMutex.
* examples/thread/threadpool.cc: The advantage of StaticMutex was that
it would silently do nothing if threads were not initialized. That
was never a useful distinction in this example anyway.
Also remove the deprecated thread_init() call.
* glib/src/thread.ccg: Mutex: Add a TODO about not using the deprecated
API.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/thread/threadpool.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/thread/threadpool.cc b/examples/thread/threadpool.cc index 542c5243..6ee38477 100644 --- a/examples/thread/threadpool.cc +++ b/examples/thread/threadpool.cc @@ -9,7 +9,7 @@ namespace { -Glib::StaticMutex mutex = GLIBMM_STATIC_MUTEX_INIT; +Glib::Mutex mutex; void print_char(char c) { @@ -31,8 +31,6 @@ void print_char(char c) int main(int, char**) { - Glib::thread_init(); - Glib::ThreadPool pool (10); for(char c = 'a'; c <= 'z'; ++c) |