From d5a4ad9dddf7b057f9ccbbb0c349d37ec425fc26 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 20 Jun 2007 18:56:52 +0000 Subject: added syslog class added threads for receiving und sending --- tunDevice.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tunDevice.cpp') diff --git a/tunDevice.cpp b/tunDevice.cpp index 2dc7971..e4cc5af 100644 --- a/tunDevice.cpp +++ b/tunDevice.cpp @@ -38,6 +38,7 @@ extern "C" { } #include "tunDevice.h" +#include "threadUtils.hpp" TunDevice::TunDevice(const char* dev_name, const char* ifcfg_lp, const char* ifcfg_rnmp) @@ -119,6 +120,7 @@ short TunDevice::read(Buffer& buf) pfd[0].events = POLLIN | POLLPRI; pfd[0].revents = 0; poll(pfd, 1, -1); + Lock lock(io_mutex_); return read_tun(dev_, buf, buf.getLength()); } @@ -126,7 +128,7 @@ int TunDevice::write(Buffer& buf) { if(!dev_) return -1; - + Lock lock(io_mutex_); return write_tun(dev_, buf, buf.getLength()); } -- cgit v1.2.3