summaryrefslogtreecommitdiff
path: root/src/socket_base.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:09:36 +0900
committerMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:09:36 +0900
commit7c2dfc65b15f62751470778284b325734d0a241b (patch)
tree1b46efb713aaa7fc10d7fd128c49d22f2bfb8645 /src/socket_base.hpp
parent891809e1074d16afa733165a164d0225937e1af9 (diff)
Socket re-entrancy rewritten
The inspiration for this re-write came form John Skaller's patch. Adding him to Credits section of the AUTHORS file. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/socket_base.hpp')
-rw-r--r--src/socket_base.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/socket_base.hpp b/src/socket_base.hpp
index 850586e..8b9a948 100644
--- a/src/socket_base.hpp
+++ b/src/socket_base.hpp
@@ -65,6 +65,10 @@ namespace xs
// This function can be called from a different thread!
void stop ();
+ // Synchronise access of application threads to the socket.
+ void lock ();
+ void unlock ();
+
// Interface for communication with the API layer.
int setsockopt (int option_, const void *optval_, size_t optvallen_);
int getsockopt (int option_, void *optval_, size_t *optvallen_);
@@ -143,6 +147,7 @@ namespace xs
// Synchronisation of access to the socket. If Crossroads are running
// in non-reentrant mode, it is a dummy mutex-like object.
+ bool reentrant;
mutex_t sync;
// If true, associated context was already terminated.