From 3c61e20f081bf6fbab6d3483e5e7f71cb91c4974 Mon Sep 17 00:00:00 2001 From: nobody Date: Thu, 5 May 2005 12:53:55 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'RepositoryManager'. --- ace/OS_Errno.h | 96 ---------------------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 ace/OS_Errno.h (limited to 'ace/OS_Errno.h') diff --git a/ace/OS_Errno.h b/ace/OS_Errno.h deleted file mode 100644 index 82446047842..00000000000 --- a/ace/OS_Errno.h +++ /dev/null @@ -1,96 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file OS_Errno.h - * - * $Id$ - * - * @author (Originally in OS.h)Doug Schmidt - */ -//============================================================================= - -#ifndef ACE_OS_ERRNO_H -#define ACE_OS_ERRNO_H -#include /**/ "ace/pre.h" - -#include "ace/ACE_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS_NS_errno.h" - -/** - * @class ACE_Errno_Guard - * - * @brief Provides a wrapper to improve performance when thread-specific - * errno must be saved and restored in a block of code. - * - * The typical use-case for this is the following: - * int error = errno; - * call_some_function_that_might_change_errno (); - * errno = error; - * This can be replaced with - * { - * ACE_Errno_Guard guard (errno); - * call_some_function_that_might_change_errno (); - * } - * This implementation is more elegant and more efficient since it - * avoids an unnecessary second access to thread-specific storage - * by caching a pointer to the value of errno in TSS. - */ -class ACE_Export ACE_Errno_Guard -{ -public: - /// Stash the value of into and initialize the - /// to the address of . - ACE_Errno_Guard (ACE_ERRNO_TYPE &errno_ref, - int error); - - /// Stash the value of into and initialize the - /// to the address of . - ACE_Errno_Guard (ACE_ERRNO_TYPE &errno_ref); - - /// Reset the value of to . - ~ACE_Errno_Guard (void); - -#if defined (ACE_HAS_WINCE_BROKEN_ERRNO) - /// Assign to . - int operator= (const ACE_ERRNO_TYPE &errno_ref); -#endif /* ACE_HAS_WINCE_BROKEN_ERRNO */ - - /// Assign to . - int operator= (int error); - - /// Compare with for equality. - bool operator== (int error); - - /// Compare with for inequality. - bool operator!= (int error); - -private: - // Prevent copying - ACE_Errno_Guard (const ACE_Errno_Guard &); - ACE_Errno_Guard &operator= (const ACE_Errno_Guard &); - -#if defined (ACE_MT_SAFE) - ACE_ERRNO_TYPE *errno_ptr_; -#endif /* ACE_MT_SAFE */ - int error_; -}; - -// Inlining this class on debug builds with gcc on Solaris can cause -// deadlocks during static initialization. -#if defined (ACE_HAS_INLINED_OSCALLS) && \ - (!defined (__GNUG__) || !defined (__sun__) || defined (ACE_NDEBUG)) -# if defined (ACE_INLINE) -# undef ACE_INLINE -# endif /* ACE_INLINE */ -# define ACE_INLINE inline -# include "ace/OS_Errno.inl" -#endif /* ACE_HAS_INLINED_OSCALLS */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_ERRNO_H */ -- cgit v1.2.1