2007-04-16 13:28:29 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Documentation by:
|
|
|
|
* Niels Sascha Reedijk <niels.reedijk@gmail.com>
|
|
|
|
* Corresponds to:
|
2010-01-19 02:14:46 +03:00
|
|
|
* /trunk/headers/os/support/SupportDefs.h rev 35018
|
2007-04-16 13:28:29 +04:00
|
|
|
*/
|
|
|
|
|
2007-03-30 17:50:00 +04:00
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\file SupportDefs.h
|
|
|
|
\ingroup support
|
|
|
|
\brief Defines basic types and definitions for the Haiku API.
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\name Fixed-Size Integer Types
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef __haiku_int8 int8
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef __haiku_uint8 uint8
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef __haiku_int16 int16
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef __haiku_uint16 uint16
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef __haiku_int32 int32
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef __haiku_uint32 uint32
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef __haiku_int64 int64
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef __haiku_uint64 uint64
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\name Fixed-size Volatile Types
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
2010-01-19 02:14:46 +03:00
|
|
|
//! @{
|
|
|
|
|
2007-03-30 17:50:00 +04:00
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile int8 vint8
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile uint8 vuint8
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile int16 vint16
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile uint16 vuint16
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile int32 vint32
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile uint32 vuint32
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile int64 vint64
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile uint64 vuint64
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
2010-01-19 02:14:46 +03:00
|
|
|
|
2007-03-30 17:50:00 +04:00
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\name Short-hand Volatile Type Names
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile long vlong
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile int vint
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile short vshort
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile char vchar
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile unsigned long vulong
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile unsigned int vuint
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile unsigned short vushort
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2010-01-19 02:14:46 +03:00
|
|
|
\typedef typedef volatile unsigned char vuchar
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
2010-01-19 02:14:46 +03:00
|
|
|
|
2007-03-30 17:50:00 +04:00
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\name Character Type Formats
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\typedef typedef unsigned char uchar
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\typedef typedef unsigned short unichar
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\name Descriptive Type Formats
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\typedef typedef int32 status_t
|
|
|
|
\brief Represents one of the status codes defined in Error.h
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\typedef typedef int64 bigtime_t
|
|
|
|
\brief Represents time. The unit depends on the context of the function.
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
2010-01-19 02:14:46 +03:00
|
|
|
/*!
|
|
|
|
\typedef typedef int64 nanotime_t
|
|
|
|
\brief Represents time in nanoseconds.
|
|
|
|
*/
|
|
|
|
|
2007-03-30 17:50:00 +04:00
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\typedef typedef uint32 type_code
|
|
|
|
\brief Represents a certain type of data. See TypeConstants.h for possible
|
|
|
|
values.
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\typedef typedef uint32 perform_code
|
|
|
|
\brief Unused. Defined by Be to support 'hidden' commands or
|
|
|
|
extensions to classes. The Haiku API has none of these.
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @}
|
2010-01-19 02:14:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\name Format strings for printf()/scanf()
|
|
|
|
*/
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRId8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIi8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRId16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIi16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRId32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIi32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRId64
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIi64
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIu8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIo8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIx8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIX8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIu16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIo16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIx16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIX16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIu32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIo32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIx32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIX32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIu64
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIo64
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIx64
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIX64
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNd8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNi8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNd16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNi16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNd32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNi32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNd64
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNi64
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNu8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNo8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNx8
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNu16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNo16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNx16
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNu32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNo32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNx32
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNu64
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNo64
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_SCNx64
|
|
|
|
*/
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\name Format strings for several standard types
|
|
|
|
*/
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIuSIZE
|
|
|
|
\brief size_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIoSIZE
|
|
|
|
\brief size_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIxSIZE
|
|
|
|
\brief size_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIXSIZE
|
|
|
|
\brief size_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIdSSIZE
|
|
|
|
\brief ssize_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIiSSIZE
|
|
|
|
\brief ssize_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIuADDR
|
|
|
|
\brief addr_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIoADDR
|
|
|
|
\brief addr_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIxADDR
|
|
|
|
\brief addr_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIXADDR
|
|
|
|
\brief addr_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIdOFF
|
|
|
|
\brief off_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIiOFF
|
|
|
|
\brief off_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIdDEV
|
|
|
|
\brief dev_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIiDEV
|
|
|
|
\brief dev_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIdINO
|
|
|
|
\brief ino_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIiINO
|
|
|
|
\brief ino_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIdTIME
|
|
|
|
\brief time_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\def B_PRIiTIME
|
|
|
|
\brief time_t
|
|
|
|
*/
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
2007-03-30 17:50:00 +04:00
|
|
|
//////////////// Odds and ends
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\var const char *B_EMPTY_STRING
|
|
|
|
\brief Defines an empty string. Currently defined as the C-string "".
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\def min_c(a,b)
|
|
|
|
\brief Returns the minimum of the values a and b.
|
2007-03-30 17:50:00 +04:00
|
|
|
|
2007-04-02 15:39:10 +04:00
|
|
|
\note When including this header in a C file, use the C equivalent called
|
|
|
|
\c min(a,b).
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\def max_c(a,b)
|
|
|
|
\brief Returns the maximum of values a and b.
|
2007-03-30 17:50:00 +04:00
|
|
|
|
2007-04-02 15:39:10 +04:00
|
|
|
\note When including this header in a C file, use the C equivalent called
|
|
|
|
\c max(a,b).
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\def NULL
|
|
|
|
\brief Defines the constant \c NULL if it hasn't been defined anywhere before.
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\addtogroup support_globals
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int32 atomic_set(vint32 *value, int32 newValue)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically set the variable \a value to \a newvalue.
|
|
|
|
|
|
|
|
This is a thread-safe way of performing the \c *value \c = \c newValue
|
|
|
|
operation. You should use these function when two or more threads might
|
|
|
|
access the variable simultaneously. You don't have to use a semaphore or a
|
|
|
|
mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
|
|
|
|
|
|
|
\sa atomic_set64() for a version that works on \c long \c long
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_test_and_set(), atomic_add(), atomic_and(),
|
|
|
|
atomic_or(), atomic_get()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int32 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically set the variable \a value to \a newValue if the current
|
|
|
|
value is \a testAgainst.
|
|
|
|
|
|
|
|
This is a thread-safe way of conditionally performing the \c *value \c +=
|
|
|
|
\c newValue operation. You should use these function when two or more threads
|
|
|
|
might access the variable simultaneously. You don't have to use a semaphore
|
|
|
|
or a mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_test_and_set64() for a version that works on \c long \c long
|
|
|
|
\sa atomic_set(), atomic_add(), atomic_and(),
|
|
|
|
atomic_or(), atomic_get()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int32 atomic_add(vint32 *value, int32 addValue)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically add the value of \a addValue to \a value.
|
|
|
|
|
|
|
|
This is a thread-safe way of performing the \c *value \c += \c addValue
|
|
|
|
operation. You should use these function when two or more threads might
|
|
|
|
access the variable simultaneously. You don't have to use a semaphore or a
|
|
|
|
mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_add64() for a version that works on \c long \c long
|
|
|
|
\sa atomic_set(), atomic_test_and_set(), atomic_and(),
|
|
|
|
atomic_or(), atomic_get()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int32 atomic_and(vint32 *value, int32 andValue)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically perform a bitwise AND operation of \a andValue to the
|
|
|
|
variable \a andValue.
|
|
|
|
|
|
|
|
This is a thread-safe way of performing the \c *value \c &= \c andValue
|
|
|
|
operation. You should use these function when two or more threads might
|
|
|
|
access the variable simultaneously. You don't have to use a semaphore or a
|
|
|
|
mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_and64() for a version that works on \c long \c long
|
|
|
|
\sa atomic_set(), atomic_test_and_set(), atomic_add(),
|
|
|
|
atomic_or(), atomic_get()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int32 atomic_or(vint32 *value, int32 orValue)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically perform a bitwise OR operation of \a orValue to the
|
|
|
|
variable \a andValue.
|
|
|
|
|
|
|
|
This is a thread-safe way of performing the \c *value \c |= \c orValue
|
|
|
|
operation. You should use these function when two or more threads might
|
|
|
|
access the variable simultaneously. You don't have to use a semaphore or a
|
|
|
|
mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_or64() for a version that works on \c long \c long
|
|
|
|
\sa atomic_set(), atomic_test_and_set(), atomic_add(), atomic_and(),
|
|
|
|
atomic_get()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int32 atomic_get(vint32 *value)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically return the value of \c value.
|
|
|
|
|
|
|
|
This is a thread-safe way of reading the contents of the \c value
|
|
|
|
operation. You should use these function when two or more threads might
|
|
|
|
access the variable simultaneously. You don't have to use a semaphore or a
|
|
|
|
mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_get64() for a version that works on \c long \c long
|
|
|
|
\sa atomic_set(), atomic_test_and_set(), atomic_add(), atomic_and(),
|
|
|
|
atomic_or()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int64 atomic_set64(vint64 *value, int64 newValue)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically set the variable \a value to \a newvalue.
|
|
|
|
|
|
|
|
This is a thread-safe way of performing the \c *value \c = \c newValue
|
|
|
|
operation. You should use these function when two or more threads might
|
|
|
|
access the variable simultaneously. You don't have to use a semaphore or a
|
|
|
|
mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
|
|
|
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_set() for a version that works on an \c int32
|
|
|
|
\sa atomic_test_and_set64(), atomic_add64(), atomic_and64(),
|
|
|
|
atomic_or64(), atomic_get64()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int64 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically set the variable \a value to \a newValue if the current
|
|
|
|
value is \a testAgainst.
|
|
|
|
|
|
|
|
This is a thread-safe way of conditionally performing the \c *value \c +=
|
|
|
|
\c newValue operation. You should use these function when two or more threads
|
|
|
|
might access the variable simultaneously. You don't have to use a semaphore
|
|
|
|
or a mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_test_and_set() for a version that works on an \c int32
|
|
|
|
\sa atomic_set64(), atomic_add64(), atomic_and64(),
|
|
|
|
atomic_or64(), atomic_get64()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int64 atomic_add64(vint64 *value, int64 addValue)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically add the value of \a addValue to \a value.
|
|
|
|
|
|
|
|
This is a thread-safe way of performing the \c *value \c += \c addValue
|
|
|
|
operation. You should use these function when two or more threads might
|
|
|
|
access the variable simultaneously. You don't have to use a semaphore or a
|
|
|
|
mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_add() for a version that works on an \c int32
|
|
|
|
\sa atomic_set64(), atomic_test_and_set64(), atomic_and64(),
|
|
|
|
atomic_or64(), atomic_get64()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int64 atomic_and64(vint64 *value, int64 andValue)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically perform a bitwise AND operation of \a andValue to the
|
|
|
|
variable \a andValue.
|
|
|
|
|
|
|
|
This is a thread-safe way of performing the \c *value \c &= \c andValue
|
|
|
|
operation. You should use these function when two or more threads might
|
|
|
|
access the variable simultaneously. You don't have to use a semaphore or a
|
|
|
|
mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_and() for a version that works on an \c int32
|
|
|
|
\sa atomic_set64(), atomic_test_and_set64(), atomic_add64(),
|
|
|
|
atomic_or64(), atomic_get64()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int64 atomic_or64(vint64 *value, int64 orValue)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically perform a bitwise OR operation of \a orValue to the
|
|
|
|
variable \a andValue.
|
|
|
|
|
|
|
|
This is a thread-safe way of performing the \c *value \c |= \c orValue
|
|
|
|
operation. You should use these function when two or more threads might
|
|
|
|
access the variable simultaneously. You don't have to use a semaphore or a
|
|
|
|
mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_or() for a version that works on an \c int32
|
|
|
|
\sa atomic_set64(), atomic_test_and_set64(), atomic_add64(), atomic_and64(),
|
|
|
|
atomic_get64()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn int64 atomic_get64(vint64 *value)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Atomically return the value of \c value.
|
|
|
|
|
|
|
|
This is a thread-safe way of reading the contents of the \c value
|
|
|
|
operation. You should use these function when two or more threads might
|
|
|
|
access the variable simultaneously. You don't have to use a semaphore or a
|
|
|
|
mutex in this case.
|
|
|
|
|
|
|
|
\return The original value of \c value.
|
2007-04-02 15:39:10 +04:00
|
|
|
\sa atomic_get() for a version that works on an \c int32
|
|
|
|
\sa atomic_set64(), atomic_test_and_set64(), atomic_add64(), atomic_and64(),
|
|
|
|
atomic_or64()
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\fn void* get_stack_frame(void)
|
2010-01-19 02:14:46 +03:00
|
|
|
\brief Internal function.
|
2007-04-02 15:39:10 +04:00
|
|
|
\internal
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
2010-01-19 02:14:46 +03:00
|
|
|
/*!
|
|
|
|
\name Deprecated defines
|
|
|
|
*/
|
|
|
|
|
2007-03-30 17:50:00 +04:00
|
|
|
//! @{
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\def FALSE
|
|
|
|
\brief Obsolete. Use \c false.
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
2007-04-02 15:39:10 +04:00
|
|
|
\def TRUE
|
|
|
|
\brief Obsolete. Use \c true.
|
2007-03-30 17:50:00 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//! @}
|