diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2010-04-29 20:34:48 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-04-29 20:34:48 +0200 |
commit | ae93ed318a450d6d763a5f629d478467f7362b07 (patch) | |
tree | 096abe5592237e31ab4d85d71b567e42d44889d4 /src/signaler.hpp | |
parent | 1ffc6dd41f2e2ce45c67f3fe08780c5a09cf667d (diff) |
signaler rewritten in such a way that any number (>64) of threads can be used
Diffstat (limited to 'src/signaler.hpp')
-rw-r--r-- | src/signaler.hpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/signaler.hpp b/src/signaler.hpp index f239771..5509894 100644 --- a/src/signaler.hpp +++ b/src/signaler.hpp @@ -20,9 +20,12 @@ #ifndef __ZMQ_SIGNALER_HPP_INCLUDED__ #define __ZMQ_SIGNALER_HPP_INCLUDED__ +#include <stddef.h> + #include "platform.hpp" #include "fd.hpp" #include "stdint.hpp" +#include "config.hpp" namespace zmq { @@ -39,14 +42,18 @@ namespace zmq signaler_t (); ~signaler_t (); - // i_signaler interface implementation. - void signal (int signal_); - uint64_t poll (); - uint64_t check (); + static const uint32_t no_signal; + + void signal (uint32_t signal_); + uint32_t poll (); + uint32_t check (); fd_t get_fd (); private: + void xpoll (); + void xcheck (); + #if defined ZMQ_HAVE_OPENVMS // Whilst OpenVMS supports socketpair - it maps to AF_INET only. @@ -64,6 +71,15 @@ namespace zmq fd_t w; fd_t r; + // Signal buffer. + uint32_t buffer [signal_buffer_size]; + + // Position of the next signal in the buffer to return to the user. + size_t current; + + // Number of signals in the signal buffer. + size_t count; + // Disable copying of fd_signeler object. signaler_t (const signaler_t&); void operator = (const signaler_t&); |