From dcf66f3cc133bf600190b844ab9c0da764e5e82b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 1 Jun 2009 23:03:29 +0200 Subject: ?berarbeitung der Request-Klasse begonnen --- src/Net/Signals/Signal0.h | 9 ++++----- src/Net/Signals/Signal1.h | 12 +++++++----- src/Net/Signals/Signal2.h | 12 +++++++----- src/Net/Signals/SignalBase.h | 10 +++++----- 4 files changed, 23 insertions(+), 20 deletions(-) (limited to 'src/Net/Signals') diff --git a/src/Net/Signals/Signal0.h b/src/Net/Signals/Signal0.h index 32859ab..c468135 100644 --- a/src/Net/Signals/Signal0.h +++ b/src/Net/Signals/Signal0.h @@ -26,13 +26,12 @@ namespace Mad { namespace Net { namespace Signals { -template -class Signal0 : public SignalBase, boost::function0 > { +class Signal0 : public SignalBase, boost::function0 > { public: - R emit() { - boost::lock_guard lock(SignalBase, boost::function0 >::mutex); + void emit() { + boost::lock_guard lock(mutex); - return SignalBase, boost::function0 >::signal(); + signal(); } }; diff --git a/src/Net/Signals/Signal1.h b/src/Net/Signals/Signal1.h index 78eaa47..b9649be 100644 --- a/src/Net/Signals/Signal1.h +++ b/src/Net/Signals/Signal1.h @@ -20,17 +20,19 @@ #ifndef MAD_NET_SIGNALS_SIGNAL1_H_ #define MAD_NET_SIGNALS_SIGNAL1_H_ +#include "SignalBase.h" + namespace Mad { namespace Net { namespace Signals { -template -class Signal1 : public SignalBase, boost::function1 > { +template +class Signal1 : public SignalBase, boost::function1 > { public: - R emit(T1 arg1) { - boost::lock_guard lock(SignalBase, boost::function1 >::mutex); + void emit(T1 arg1) { + boost::lock_guard lock(SignalBase, boost::function1 >::mutex); - return SignalBase, boost::function1 >::signal(arg1); + SignalBase, boost::function1 >::signal(arg1); } }; diff --git a/src/Net/Signals/Signal2.h b/src/Net/Signals/Signal2.h index afa528e..374a239 100644 --- a/src/Net/Signals/Signal2.h +++ b/src/Net/Signals/Signal2.h @@ -20,17 +20,19 @@ #ifndef MAD_NET_SIGNALS_SIGNAL2_H_ #define MAD_NET_SIGNALS_SIGNAL2_H_ +#include "SignalBase.h" + namespace Mad { namespace Net { namespace Signals { -template -class Signal2 : public SignalBase, boost::function2 > { +template +class Signal2 : public SignalBase, boost::function2 > { public: - R emit(T1 arg1, T2 arg2) { - boost::lock_guard lock(SignalBase, boost::function2 >::mutex); + void emit(T1 arg1, T2 arg2) { + boost::lock_guard lock(SignalBase, boost::function2 >::mutex); - return SignalBase, boost::function2 >::signal(arg1, arg2); + SignalBase, boost::function2 >::signal(arg1, arg2); } }; diff --git a/src/Net/Signals/SignalBase.h b/src/Net/Signals/SignalBase.h index fc5f2c6..9e2de62 100644 --- a/src/Net/Signals/SignalBase.h +++ b/src/Net/Signals/SignalBase.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include namespace Mad { namespace Net { @@ -40,19 +40,19 @@ class SignalBase : private boost::noncopyable { typedef SignalType signal_type; std::set connections; - boost::recursive_mutex mutex; + boost::mutex mutex; signal_type signal; SignalBase() {} ~SignalBase() { // Wait for other threads - boost::lock_guard lock(mutex); + boost::lock_guard lock(mutex); } public: Connection connect(const slot_type &slot) { - boost::lock_guard lock(mutex); + boost::lock_guard lock(mutex); boost::signals::connection con(signal.connect(slot)); @@ -61,7 +61,7 @@ class SignalBase : private boost::noncopyable { } void disconnect(const Connection &connection) { - boost::lock_guard lock(mutex); + boost::lock_guard lock(mutex); std::set::iterator it = connections.find(connection.connection); -- cgit v1.2.3