From 4dd51af78f2d153d5cd564540a0733133643a064 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Thu, 31 Jul 2014 09:26:57 +0000 Subject: added a go style channel implementation. this might still need some performance tweaks (use less semaphores, maybee not use ringbuffer) --- src/anytun.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/anytun.cpp') diff --git a/src/anytun.cpp b/src/anytun.cpp index 3f14a5e..9e97e5a 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -91,6 +91,7 @@ #endif #include "cryptinit.hpp" +#include "channel.hpp" #include "sysExec.h" bool disableRouting = false; @@ -339,7 +340,12 @@ void receiver(TunDevice* dev, PacketSource* src) void startSendRecvThreads(TunDevice* dev, PacketSource* src) { src->waitUntilReady(); - + //channel a(1); + //a.push(23); + //a.push(23); + //int i=0; + //a.pop(i); + //std::cout << i << std::endl; boost::thread(boost::bind(sender, dev, src)); boost::thread(boost::bind(receiver, dev, src)); } -- cgit v1.2.3