diff options
author | GZharun <grygoriiz@wavesglobal.com> | 2015-02-24 14:27:36 +0200 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-29 14:16:42 -0400 |
commit | ef59fbffa17c6ed08e22d17daaea0d6fa4c4ce18 (patch) | |
tree | 08d0852c0795b0d769686a713e006db8dba7f93f /libs/pbd | |
parent | 017e580c9f1f03f6dab574406aaad028bebc452a (diff) |
[Summary] Added possibility to identify IO thread which does not have required resources initialized during process callback handling
Conflicts:
libs/ardour/ardour/audioengine.h
libs/backends/wavesaudio/waves_audiobackend.cc
libs/pbd/pbd/pool.h
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/pbd/pool.h | 2 | ||||
-rw-r--r-- | libs/pbd/pool.cc | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/libs/pbd/pbd/pool.h b/libs/pbd/pbd/pool.h index cfd782a794..aff3f7ea21 100644 --- a/libs/pbd/pbd/pool.h +++ b/libs/pbd/pbd/pool.h @@ -129,7 +129,7 @@ class LIBPBD_API PerThreadPool void create_per_thread_pool (std::string name, unsigned long item_size, unsigned long nitems); CrossThreadPool* per_thread_pool (bool must_exist = true); - + bool has_per_thread_pool (); void set_trash (RingBuffer<CrossThreadPool*>* t); void add_to_trash (CrossThreadPool *); diff --git a/libs/pbd/pool.cc b/libs/pbd/pool.cc index 020f296f61..404fab60e3 100644 --- a/libs/pbd/pool.cc +++ b/libs/pbd/pool.cc @@ -175,6 +175,20 @@ PerThreadPool::create_per_thread_pool (string n, unsigned long isize, unsigned l _key.set (new CrossThreadPool (n, isize, nitems, this)); } +/** @return True if CrossThreadPool for the current thread exists, + * False otherwise + */ +bool +PerThreadPool::has_per_thread_pool () +{ + CrossThreadPool* p = _key.get(); + if (p) { + return true; + } + return false; +} + + /** @return CrossThreadPool for the current thread, which must previously have been created by * calling create_per_thread_pool in the current thread. */ |