diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-10 19:59:37 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-10 19:59:37 +0000 |
commit | 3df4acfa816441fc28a95dee6d0191a927145d95 (patch) | |
tree | b5ae7ca44662cfd8e5c95f1826e4406021a606f5 /ace/Test_and_Set.h | |
parent | 60a5612b83d856fc0adc52b9f39fac9960ec9818 (diff) | |
download | ATCD-pre-subset.tar.gz |
This commit was manufactured by cvs2svn to create tag 'pre-subset'.pre-subset
Diffstat (limited to 'ace/Test_and_Set.h')
-rw-r--r-- | ace/Test_and_Set.h | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/ace/Test_and_Set.h b/ace/Test_and_Set.h deleted file mode 100644 index 4def53af1bd..00000000000 --- a/ace/Test_and_Set.h +++ /dev/null @@ -1,76 +0,0 @@ - -//============================================================================= -/** - * @file Test_and_Set.h - * - * $Id$ - * - * @author Priyanka Gontla <pgontla@ece.uci.edu> - */ -//============================================================================= - - -#ifndef ACE_TEST_AND_SET_H -#define ACE_TEST_AND_SET_H - -#include "ace/pre.h" -#include "ace/Event_Handler.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/** - * @class ACE_Test_and_Set - * - * @brief Implements the classic ``test and set'' operation. - * - * - * This class keeps track of the status of <is_set_>, which can - * be set based on various events (such as receipt of a - * signal). This class is derived from <ACE_Event_Handler> so - * that it can be "signaled" by a Reactor when a signal occurs. - * We assume that <TYPE> is a data type that can be assigned the - * value 0 or 1. - */ -template <class ACE_LOCK, class TYPE> -class ACE_Test_and_Set : public ACE_Event_Handler -{ -public: - ACE_Test_and_Set (TYPE initial_value = 0); - - /// Returns true if we are set, else false. - TYPE is_set (void) const; - - /// Sets the <is_set_> status, returning the original value of - /// <is_set_>. - TYPE set (TYPE); - - /// Called when object is signaled by OS (either via UNIX signals or - /// when a Win32 object becomes signaled). - virtual int handle_signal (int signum, - siginfo_t * = 0, - ucontext_t * = 0); - -private: - /// Keeps track of our state. - TYPE is_set_; - - /// Protect the state from race conditions. - ACE_LOCK lock_; -}; - -#if defined (__ACE_INLINE__) -#include "ace/Test_and_Set.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Test_and_Set.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Test_and_Set.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ACE_TEST_AND_SET_H */ |