summaryrefslogtreecommitdiffstats
path: root/delaypipe.hh
diff options
context:
space:
mode:
Diffstat (limited to 'delaypipe.hh')
-rw-r--r--delaypipe.hh7
1 files changed, 4 insertions, 3 deletions
diff --git a/delaypipe.hh b/delaypipe.hh
index ad1626a..b12fd50 100644
--- a/delaypipe.hh
+++ b/delaypipe.hh
@@ -20,10 +20,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
-#include <map>
#include <time.h>
#include <thread>
+#include "channel.hh"
+
/**
General idea: many threads submit work to this class, but only one executes it. The work should therefore be entirely trivial.
The implementation is that submitter threads create an object that represents the work, and it gets sent over a pipe
@@ -41,12 +42,12 @@ class ObjectPipe
{
public:
ObjectPipe();
- ~ObjectPipe();
void write(T& t);
int readTimeout(T* t, double msec); //!< -1 is timeout, 0 is no data, 1 is data. msec<0 waits infinitely long. msec==0 = undefined
void close();
private:
- int d_fds[2];
+ pdns::channel::Sender<T> d_sender;
+ pdns::channel::Receiver<T> d_receiver;
};
template<class T>