summaryrefslogtreecommitdiff
path: root/examples/thread
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjell.ahlstedt@bredband.net>2012-02-28 16:13:03 +0100
committerKjell Ahlstedt <kjell.ahlstedt@bredband.net>2012-02-28 16:13:03 +0100
commit5a59b62212f0b8875da815a5d136d7a0c2899fdf (patch)
treed5d66f3df76df93b244cce2dd789537afae3fc34 /examples/thread
parent423e6fbb104bb08ab876f1642b043de996467f0b (diff)
downloadglibmm-5a59b62212f0b8875da815a5d136d7a0c2899fdf.tar.gz
Fix exceptions thrown by Thread::create() and Threads::Thread::create.
* glib/src/thread.ccg: create(): Call g_thread_try_new() instead of g_thread_new(). Throw a Glib::ThreadError when appropriate, instead of calling Glib::Error::throw_exception(), which would throw Glib::Threads::ThreadError. * glib/src/threads.ccg:create(): Call g_thread_try_new() instead of g_thread_new(). Remove parameter 'joinable'. * glib/src/threads.hg: Remove parameter 'joinable'. Remove comments about non-joinable threads and thread priorities. * examples/network/resolver.cc: * examples/network/socket-client.cc: * examples/network/socket-server.cc: * examples/thread/dispatcher.cc: * examples/thread/dispatcher2.cc: * examples/thread/thread.cc: Remove parameter 'joinable' in calls to Glib::Threads::Thread::create(). Bug #640029.
Diffstat (limited to 'examples/thread')
-rw-r--r--examples/thread/dispatcher.cc2
-rw-r--r--examples/thread/dispatcher2.cc2
-rw-r--r--examples/thread/thread.cc4
3 files changed, 4 insertions, 4 deletions
diff --git a/examples/thread/dispatcher.cc b/examples/thread/dispatcher.cc
index 7725b3ee..1ed0c9c2 100644
--- a/examples/thread/dispatcher.cc
+++ b/examples/thread/dispatcher.cc
@@ -102,7 +102,7 @@ int ThreadProgress::id() const
void ThreadProgress::launch()
{
// Create a joinable thread.
- thread_ = Glib::Threads::Thread::create(sigc::mem_fun(*this, &ThreadProgress::thread_function), true);
+ thread_ = Glib::Threads::Thread::create(sigc::mem_fun(*this, &ThreadProgress::thread_function));
}
void ThreadProgress::join()
diff --git a/examples/thread/dispatcher2.cc b/examples/thread/dispatcher2.cc
index 63b06d33..d42e2246 100644
--- a/examples/thread/dispatcher2.cc
+++ b/examples/thread/dispatcher2.cc
@@ -97,7 +97,7 @@ void ThreadTimer::launch()
// Create a joinable thread -- it needs to be joined, otherwise it's a memory leak.
thread_ = Glib::Threads::Thread::create(
- sigc::mem_fun(*this, &ThreadTimer::thread_function), true);
+ sigc::mem_fun(*this, &ThreadTimer::thread_function));
// Wait for the 2nd thread's startup notification.
while(signal_finished_ptr_ == NULL)
diff --git a/examples/thread/thread.cc b/examples/thread/thread.cc
index 581bdf5c..6cfa904e 100644
--- a/examples/thread/thread.cc
+++ b/examples/thread/thread.cc
@@ -98,10 +98,10 @@ int main(int, char**)
MessageQueue queue;
Glib::Threads::Thread *const producer = Glib::Threads::Thread::create(
- sigc::mem_fun(queue, &MessageQueue::producer), true);
+ sigc::mem_fun(queue, &MessageQueue::producer));
Glib::Threads::Thread *const consumer = Glib::Threads::Thread::create(
- sigc::mem_fun(queue, &MessageQueue::consumer), true);
+ sigc::mem_fun(queue, &MessageQueue::consumer));
producer->join();
consumer->join();