00001
00002
00003 #ifndef ACE_TEST_AND_SET_CPP
00004 #define ACE_TEST_AND_SET_CPP
00005
00006 #include "ace/Test_and_Set.h"
00007 #include "ace/Guard_T.h"
00008
00009 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00010 # pragma once
00011 #endif
00012
00013 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00014
00015 template <class ACE_LOCK, class TYPE>
00016 ACE_Test_and_Set<ACE_LOCK, TYPE>::ACE_Test_and_Set (TYPE initial_value)
00017 : is_set_ (initial_value)
00018 {
00019 }
00020
00021
00022 template <class ACE_LOCK, class TYPE> TYPE
00023 ACE_Test_and_Set<ACE_LOCK, TYPE>::is_set (void) const
00024 {
00025 ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->lock_, this->is_set_);
00026 return this->is_set_;
00027 }
00028
00029
00030 template <class ACE_LOCK, class TYPE> TYPE
00031 ACE_Test_and_Set<ACE_LOCK, TYPE>::set (TYPE status)
00032 {
00033 ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, this->is_set_);
00034 TYPE o_status = this->is_set_;
00035 this->is_set_ = status;
00036 return o_status;
00037 }
00038
00039 template <class ACE_LOCK, class TYPE> int
00040 ACE_Test_and_Set<ACE_LOCK, TYPE>::handle_signal (int, siginfo_t *, ucontext_t *)
00041 {
00042
00043
00044
00045 this->set (1);
00046 return 0;
00047 }
00048
00049 ACE_END_VERSIONED_NAMESPACE_DECL
00050
00051 #endif