C/C++ User's Journal STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - where the Standard Template Library meets the Active Template Library COMSTL - where the Standard Template Library meets the Component Object Model
Synesis Software InetSTL - where the Standard Template Library meets the Internet UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

H:/freelibs/recls/current/src/recls_atomic.h

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////////
00002  * File:        recls_atomic.h
00003  *
00004  * Purpose:     Implementation header.
00005  *
00006  * Created:     11th March 2005
00007  * Updated:     5th October 2006
00008  *
00009  * Home:        http://recls.org/
00010  *
00011  * Copyright (c) 2005-2006, Matthew Wilson and Synesis Software
00012  * All rights reserved.
00013  *
00014  * Redistribution and use in source and binary forms, with or without 
00015  * modification, are permitted in accordance with the license and warranty
00016  * information described in recls.h (included in this distribution, or available
00017  * from http://recls.org/)
00018  *
00019  * ////////////////////////////////////////////////////////////////////////// */
00020 
00021 
00022 #ifndef RECLS_INCL_H_RECLS_ATOMIC
00023 #define RECLS_INCL_H_RECLS_ATOMIC
00024 
00025 /* File version */
00026 #ifndef RECLS_DOCUMENTATION_SKIP_SECTION
00027 # define RECLS_VER_H_RECLS_ATOMIC_MAJOR     2
00028 # define RECLS_VER_H_RECLS_ATOMIC_MINOR     0
00029 # define RECLS_VER_H_RECLS_ATOMIC_REVISION  1
00030 # define RECLS_VER_H_RECLS_ATOMIC_EDIT      7
00031 #endif /* !RECLS_DOCUMENTATION_SKIP_SECTION */
00032 
00036 /* /////////////////////////////////////////////////////////////////////////////
00037  * Includes
00038  */
00039 
00040 /* recls Header Files */
00041 #include <recls/recls.h>
00042 #include "recls_impl.h"
00043 
00044 /* /////////////////////////////////////////////////////////////////////////////
00045  * Namespace
00046  */
00047 
00048 #if !defined(RECLS_NO_NAMESPACE)
00049 namespace recls
00050 {
00051 #endif /* !RECLS_NO_NAMESPACE */
00052 
00053 /* /////////////////////////////////////////////////////////////////////////////
00054  * Typedefs
00055  */
00056 
00057 #if defined(RECLS_PLATFORM_IS_UNIX) && \
00058     defined(_RECLS_MT) && \
00059     defined(RECLS_UNIX_USE_ATOMIC_OPERATIONS)
00060 typedef atomic_t                rc_atomic_t;
00061 # define rc_atomic_init(x)      ATOMIC_INIT(x)
00062 #else /* ? _RECLS_MT && RECLS_UNIX_USE_ATOMIC_OPERATIONS */
00063 typedef recls_sint32_t          rc_atomic_t;
00064 # define rc_atomic_init(x)      x
00065 #endif /* _RECLS_MT && RECLS_UNIX_USE_ATOMIC_OPERATIONS */
00066 
00067 /* /////////////////////////////////////////////////////////////////////////////
00068  * Functions
00069  */
00070 
00071 RECLS_FNDECL(void)          RC_Increment(rc_atomic_t volatile *p);
00072 RECLS_FNDECL(rc_atomic_t)   RC_PreDecrement(rc_atomic_t volatile *p);
00073 RECLS_FNDECL(rc_atomic_t)   RC_ReadValue(rc_atomic_t volatile *p);
00074 
00075 /* /////////////////////////////////////////////////////////////////////////////
00076  * Namespace
00077  */
00078 
00079 #if !defined(RECLS_NO_NAMESPACE)
00080 } /* namespace recls */
00081 #endif /* !RECLS_NO_NAMESPACE */
00082 
00083 /* ////////////////////////////////////////////////////////////////////////// */
00084 
00085 #endif /* !RECLS_INCL_H_RECLS_ATOMIC */
00086 
00087 /* ////////////////////////////////////////////////////////////////////////// */

recls Library documentation © Synesis Software Pty Ltd, 2001-2006