summaryrefslogtreecommitdiffstats
path: root/src/server/BufferFactory.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-12 07:04:11 +0000
committerDavid Robillard <d@drobilla.net>2012-05-12 07:04:11 +0000
commit52011c3b045d9f49a4bc25c9f545bb35e5c2a0a9 (patch)
tree29012d7da9bf9e0525574b3d8713eaf828626ac5 /src/server/BufferFactory.cpp
parent2e8a9b483a8d2ca7ba2a4feb4a845a32ab1eebeb (diff)
downloadingen-52011c3b045d9f49a4bc25c9f545bb35e5c2a0a9.tar.gz
ingen-52011c3b045d9f49a4bc25c9f545bb35e5c2a0a9.tar.bz2
ingen-52011c3b045d9f49a4bc25c9f545bb35e5c2a0a9.zip
More work towards checking contexts via parameter rather than thread magic.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4376 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/BufferFactory.cpp')
-rw-r--r--src/server/BufferFactory.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/server/BufferFactory.cpp b/src/server/BufferFactory.cpp
index cc02ba08..2726d7e3 100644
--- a/src/server/BufferFactory.cpp
+++ b/src/server/BufferFactory.cpp
@@ -88,7 +88,10 @@ BufferFactory::default_buffer_size(LV2_URID type)
}
BufferRef
-BufferFactory::get(LV2_URID type, uint32_t capacity, bool force_create)
+BufferFactory::get(Context& context,
+ LV2_URID type,
+ uint32_t capacity,
+ bool force_create)
{
Raul::AtomicPtr<Buffer>& head_ptr = free_list(type);
Buffer* try_head = NULL;
@@ -104,7 +107,7 @@ BufferFactory::get(LV2_URID type, uint32_t capacity, bool force_create)
}
if (!try_head) {
- if (!ThreadManager::thread_is(THREAD_PROCESS)) {
+ if (!_engine.is_process_context(context)) {
return create(type, capacity);
} else {
assert(false);
@@ -126,8 +129,6 @@ BufferFactory::silent_buffer()
BufferRef
BufferFactory::create(LV2_URID type, uint32_t capacity)
{
- ThreadManager::assert_not_thread(THREAD_PROCESS);
-
Buffer* buffer = NULL;
if (capacity == 0) {