summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/block_allocator.cpp6
-rw-r--r--lib/gras_impl/block_actor.hpp1
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/block_allocator.cpp b/lib/block_allocator.cpp
index 8f42e57..bd2f3c2 100644
--- a/lib/block_allocator.cpp
+++ b/lib/block_allocator.cpp
@@ -11,7 +11,7 @@ const size_t AT_LEAST_BYTES = 32*(1024); //kiB per buffer
const size_t AHH_TOO_MANY_BYTES = 32*(1024*1024); //MiB enough for me
const size_t THIS_MANY_BUFFERS = 8; //pool size
-void BlockActor::buffer_returner(const size_t index, SBuffer &buffer)
+static void buffer_returner(ThreadPool tp, Theron::Address addr, const size_t index, SBuffer &buffer)
{
//reset offset and length
buffer.offset = 0;
@@ -20,7 +20,7 @@ void BlockActor::buffer_returner(const size_t index, SBuffer &buffer)
OutputBufferMessage message;
message.index = index;
message.buffer = buffer;
- this->Push(message, Theron::Address());
+ tp->Send(message, Theron::Address::Null(), addr);
}
static size_t recommend_length(
@@ -67,7 +67,7 @@ void BlockActor::handle_top_alloc(const TopAllocMessage &, const Theron::Address
this->output_configs[i].maximum_items*this->output_configs[i].item_size
);
- SBufferDeleter deleter = boost::bind(&BlockActor::buffer_returner, this, i, _1);
+ SBufferDeleter deleter = boost::bind(&buffer_returner, this->thread_pool, this->GetAddress(), i, _1);
SBufferToken token = SBufferToken(new SBufferDeleter(deleter));
SBufferConfig config;
diff --git a/lib/gras_impl/block_actor.hpp b/lib/gras_impl/block_actor.hpp
index a8586c0..2799313 100644
--- a/lib/gras_impl/block_actor.hpp
+++ b/lib/gras_impl/block_actor.hpp
@@ -94,7 +94,6 @@ struct BlockActor : Apology::Worker
void handle_get_stats(const GetStatsMessage &, const Theron::Address);
//helpers
- void buffer_returner(const size_t index, SBuffer &buffer);
void mark_done(void);
void task_main(void);
void input_fail(const size_t index);