ACE_OS Namespace Reference

This namespace defines an OS independent programming API that shields developers from nonportable aspects of writing efficient system programs on Win32, POSIX and other versions of UNIX, and various real-time operating systems.
More...

Variables

Detailed Description

This namespace defines an OS independent programming API that shields developers from nonportable aspects of writing efficient system programs on Win32, POSIX and other versions of UNIX, and various real-time operating systems.

This class encapsulates the differences between various OS platforms. When porting ACE to a new platform, this class is the place to focus on. Once this file is ported to a new platform, pretty much everything else comes for "free." See <www.cs.wustl.edu/~schmidt/ACE_wrappers/etc/ACE-porting.html> for instructions on porting ACE. Please see the README file in this directory for complete information on the meaning of the various macros.

If <timeout> == 0, calls <ACE_OS::mutex_lock(m)>. Otherwise, this method attempts to acquire a lock, but gives up if the lock has not been acquired by the given time, in which case it returns -1 with an <ETIME> errno on platforms that actually support timed mutexes. The timeout should be an absolute time. Note that the mutex should not be a recursive one, i.e., it should only be a standard mutex or an error checking mutex.

This method attempts to acquire a lock, but gives up if the lock has not been acquired by the given time. If the lock is not acquired within the given amount of time, then this method returns -1 with an <ETIME> errno on platforms that actually support timed mutexes. The timeout should be an absolute time. Note that the mutex should not be a recursive one, i.e., it should only be a standard mutex or an error checking mutex.

ACE_INLINE int ACE_OS::mutex_lock

(

ACE_mutex_t *

m,

int &

abandoned

)

This method is only implemented for Win32. For abandoned mutexes, <abandoned> is set to 1 and 0 is returned.

ACE_INLINE int ACE_OS::mutex_lock

(

ACE_mutex_t *

m

)

Win32 note: Abandoned mutexes are not treated differently. 0 is returned since the calling thread does get the ownership.

If <timeout> == 0, calls <ACE_OS::mutex_lock(m)>. Otherwise, this method attempts to acquire a lock, but gives up if the lock has not been acquired by the given time, in which case it returns -1 with an <ETIME> errno on platforms that actually support timed mutexes. The timeout should be an absolute time. Note that the mutex should not be a recursive one, i.e., it should only be a standard mutex or an error checking mutex.

This method attempts to acquire a lock, but gives up if the lock has not been acquired by the given time. If the lock is not acquired within the given amount of time, then this method returns -1 with an <ETIME> errno on platforms that actually support timed mutexes. The timeout should be an absolute time. Note that the mutex should not be a recursive one, i.e., it should only be a standard mutex or an error checking mutex.

ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::mutex_lock

(

ACE_mutex_t *

m,

int &

abandoned

)

This method is only implemented for Win32. For abandoned mutexes, <abandoned> is set to 1 and 0 is returned.

ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::mutex_lock

(

ACE_mutex_t *

m

)

Win32 note: Abandoned mutexes are not treated differently. 0 is returned since the calling thread does get the ownership.

ACE_Export void ACE_OS::mutex_lock_cleanup

(

void *

mutex

)

Handle asynchronous thread cancellation cleanup.

ACE_INLINE int ACE_OS::mutex_trylock

(

ACE_mutex_t *

m,

int &

abandoned

)

This method is only implemented for Win32. For abandoned mutexes, <abandoned> is set to 1 and 0 is returned.

ACE_INLINE int ACE_OS::mutex_trylock

(

ACE_mutex_t *

m

)

Win32 note: Abandoned mutexes are not treated differently. 0 is returned since the calling thread does get the ownership.

ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::mutex_trylock

(

ACE_mutex_t *

m,

int &

abandoned

)

This method is only implemented for Win32. For abandoned mutexes, <abandoned> is set to 1 and 0 is returned.

ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::mutex_trylock

(

ACE_mutex_t *

m

)

Win32 note: Abandoned mutexes are not treated differently. 0 is returned since the calling thread does get the ownership.

The O_APPEND flag is only partly supported on Win32. If you specify O_APPEND, then the file pointer will be positioned at the end of the file initially during open, but it is not re-positioned at the end prior to each write, as specified by POSIX. This is generally good enough for typical situations, but it is ``not quite right'' in its semantics.

Receive <len> bytes into <buf> from <handle> (uses the <ACE_OS::read> call, which uses the <read> system call on UNIX and the <ReadFile> call on Win32). If errors occur, -1 is returned. If EOF occurs, 0 is returned. Whatever data has been read will be returned to the caller through<bytes_transferred>.