"Dinkum/threads/recursive_mutex"


Include the header "Dinkum/threads/recursive_mutex" to define the recursive mutex classes recursive_mutex, recursive_try_mutex, and recursive_timed_mutex.

namespace Dinkum {
    namespace threads {
    class recursive_mutex;
    class recursive_try_mutex;
    class recursive_timed_mutex;
    }  // namespace threads
} // namespace Dinkum

recursive_mutex

class recursive_mutex
    {
public:
    recursive_mutex();
    ~recursive_mutex();
    typedef SL0 scoped_lock;

    // exposition only
private:
    // not implemented
    recursive_mutex(const recursive_mutex&);
    recursive_mutex& operator= (const recursive_mutex&);
    };

The class describes an object that can be used with a lock object to provide a recursive mutex object. Objects of class recursive_mutex cannot be copied.

recursive_mutex::recursive_mutex

recursive_mutex();

The constructor constructs a mutex in the unlocked state.

recursive_mutex::~recursive_mutex

~recursive_mutex();

Precondition: the object must not be locked.

The destructor releases any resources used by the object.

recursive_timed_mutex

class recursive_timed_mutex
    {
public:
    recursive_timed_mutex();
    ~recursive_timed_mutex();
    typedef SL0 scoped_lock;
    typedef SL1 scoped_try_lock;
    typedef SL2 scoped_timed_lock;

    // exposition only
private:
    // not implemented
    recursive_timed_mutex(const recursive_timed_mutex&);
    recursive_timed_mutex& operator= (const recursive_timed_mutex&);
    };

The class describes an object that can be used with a scoped_lock, a scoped_try_lock, or a scoped_timed_lock to provide a recursive mutex object that supports test and return and timeout. Objects of class recursive_timed_mutex cannot be copied.

recursive_timed_mutex::recursive_timed_mutex

recursive_timed_mutex();

The constructor constructs a recursive_timed_mutex in the unlocked state.

recursive_timed_mutex::~recursive_timed_mutex

~recursive_timed_mutex();

Precondition: the object must not be locked.

The destructor releases any resources used by the object.

recursive_try_mutex

class recursive_try_mutex
    {
public:
    recursive_try_mutex();
    ~recursive_try_mutex();
    typedef SL0 scoped_lock;
    typedef SL1 scoped_try_lock;

    // exposition only
private:
    // not implemented
    recursive_try_mutex(const recursive_try_mutex&);
    recursive_try_mutex& operator= (const recursive_try_mutex&);
    };

The class describes an object that can be used with a scoped_lock or a scoped_try_lock to provide a recursive mutex object that supports test and return. Objects of class recursive_try_mutex cannot be copied.

recursive_try_mutex::recursive_try_mutex

recursive_try_mutex();

The constructor constructs a recursive_try_mutex in the unlocked state.

recursive_try_mutex::~recursive_try_mutex

~recursive_try_mutex();

Precondition: the object must not be locked.

The destructor releases any resources used by the object.


See also the Table of Contents and the Index.

Copyright (c) by P.J. Plauger. All rights reserved.