diff options
author | Marcin Kolny <marcin.kolny@gmail.com> | 2015-08-08 14:45:12 +0200 |
---|---|---|
committer | Marcin Kolny <marcin.kolny@gmail.com> | 2015-08-08 14:45:59 +0200 |
commit | 0d5f63b18f5766760cf39e82ee11482984e0a938 (patch) | |
tree | e3f74b9b37e7618c92840024077dff43e6d08f0d /glib/glibmm/threadpool.cc | |
parent | dce7a844e48a582e42eb2b60eef5c1f2527540ac (diff) | |
parent | d94115843f38967b5e883f5f7d8057882ae364cb (diff) | |
download | glibmm-gir-gmmproc.tar.gz |
Merge branch 'master' into glibmm-gir-gmmprocglibmm-gir-gmmproc
Diffstat (limited to 'glib/glibmm/threadpool.cc')
-rw-r--r-- | glib/glibmm/threadpool.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/glib/glibmm/threadpool.cc b/glib/glibmm/threadpool.cc index 9a9af184..a007a435 100644 --- a/glib/glibmm/threadpool.cc +++ b/glib/glibmm/threadpool.cc @@ -34,6 +34,10 @@ public: SlotList(); ~SlotList(); + // noncopyable + SlotList(const ThreadPool::SlotList&) = delete; + ThreadPool::SlotList& operator=(const ThreadPool::SlotList&) = delete; + sigc::slot<void>* push(const sigc::slot<void>& slot); sigc::slot<void> pop(sigc::slot<void>* slot_ptr); @@ -42,10 +46,6 @@ public: private: Glib::Threads::Mutex mutex_; std::list< sigc::slot<void> > list_; - - // noncopyable - SlotList(const ThreadPool::SlotList&); - ThreadPool::SlotList& operator=(const ThreadPool::SlotList&); }; ThreadPool::SlotList::SlotList() @@ -128,7 +128,7 @@ ThreadPool::ThreadPool(int max_threads, bool exclusive) gobject_ (0), slot_list_ (new SlotList()) { - GError* error = 0; + GError* error = nullptr; gobject_ = g_thread_pool_new( &call_thread_entry_slot, slot_list_, max_threads, exclusive, &error); @@ -136,7 +136,7 @@ ThreadPool::ThreadPool(int max_threads, bool exclusive) if(error) { delete slot_list_; - slot_list_ = 0; + slot_list_ = nullptr; Glib::Error::throw_exception(error); } } @@ -157,7 +157,7 @@ void ThreadPool::push(const sigc::slot<void>& slot) { sigc::slot<void> *const slot_ptr = slot_list_->push(slot); - GError* error = 0; + GError* error = nullptr; g_thread_pool_push(gobject_, slot_ptr, &error); if(error) @@ -169,7 +169,7 @@ void ThreadPool::push(const sigc::slot<void>& slot) void ThreadPool::set_max_threads(int max_threads) { - GError* error = 0; + GError* error = nullptr; g_thread_pool_set_max_threads(gobject_, max_threads, &error); if(error) @@ -193,7 +193,7 @@ unsigned int ThreadPool::unprocessed() const bool ThreadPool::get_exclusive() const { - g_return_val_if_fail(gobject_ != 0, false); + g_return_val_if_fail(gobject_ != nullptr, false); return gobject_->exclusive; } @@ -203,14 +203,14 @@ void ThreadPool::shutdown(bool immediately) if(gobject_) { g_thread_pool_free(gobject_, immediately, 1); - gobject_ = 0; + gobject_ = nullptr; } if(slot_list_) { slot_list_->lock_and_unlock(); delete slot_list_; - slot_list_ = 0; + slot_list_ = nullptr; } } |