diff options
author | Christian Pointner <equinox@anytun.org> | 2007-06-20 18:56:52 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2007-06-20 18:56:52 +0000 |
commit | d5a4ad9dddf7b057f9ccbbb0c349d37ec425fc26 (patch) | |
tree | 960a83fee909f14ff235b515f75d5cc20411d85f /tunDevice.cpp | |
parent | begin multi threading (diff) |
added syslog class
added threads for receiving und sending
Diffstat (limited to 'tunDevice.cpp')
-rw-r--r-- | tunDevice.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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()); } |