ACE_Lock(3)

ACE_Lock3

This is the abstract base class that contains the uniform locking api that is supported by all the ace synchronization mechanisms.

Usage

#include <ace/Synch.h>
class ACE_Lock
{
  public:
    ACE_Lock (void);
    virtual ~ACE_Lock (void);
    virtual int remove (void) = 0;
    virtual int acquire (void) = 0;
    virtual int tryacquire (void) = 0;
    virtual int release (void) = 0;
    virtual int acquire_read (void) = 0;
    virtual int acquire_write (void) = 0;
    virtual int tryacquire_read (void) = 0;
    virtual int tryacquire_write (void) = 0;
};

Overview

Wrappers for various synchronization routines.

Public members

ACE_Lock (void);

CE needs a default ctor here.

virtual ~ACE_Lock (void);

Noop virtual destructor

virtual int remove (void) = 0;

Explicitly destroy the lock. Note that only one thread should call this method since it doesn't protect against race conditions.

virtual int acquire (void) = 0;

Block the thread until the lock is acquired. Returns -1 on failure.

virtual int tryacquire (void) = 0;

Conditionally acquire the lock (i.e., won't block). Returns -1 on failure. If we "failed" because someone else already had the lock, errno is set to EBUSY.

virtual int release (void) = 0;

Release the lock. Returns -1 on failure.

virtual int acquire_read (void) = 0;

Block until the thread acquires a read lock. If the locking mechanism doesn't support read locks then this just calls acquire. Returns -1 on failure.

virtual int acquire_write (void) = 0;

Block until the thread acquires a write lock. If the locking mechanism doesn't support read locks then this just calls acquire. Returns -1 on failure.

virtual int tryacquire_read (void) = 0;

Conditionally acquire a read lock. If the locking mechanism doesn't support read locks then this just calls acquire. Returns -1 on failure. If we "failed" because someone else already had the lock, errno is set to EBUSY.

virtual int tryacquire_write (void) = 0;

Conditionally acquire a write lock. If the locking mechanism doesn't support read locks then this just calls acquire. Returns -1 on failure. If we "failed" because someone else already had the lock, errno is set to EBUSY.

Library

ace

Author

Doug Schmidt

From libace-doc 5.0.7-4 in Debian 2.2 (Potato). Parsed by carta from the page's man source.