---
name: "ACE_recursive_thread_mutex_t"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_recursive_thread_mutex_t"
---

# ACE\_recursive\_thread\_mutex\_t(3)

Implement a thin C++ wrapper that allows nested acquisition and release of a mutex that occurs in the same thread.

## NAME

ACE\_recursive\_thread\_mutex\_t -  Implement a thin C++ wrapper that allows nested acquisition and release of a mutex that occurs in the same thread.

## SYNOPSIS

```
#include <ace/OS.h>
class ACE_recursive_thread_mutex_t
{
  public:
    ACE_thread_mutex_t nesting_mutex_;
    ACE_cond_t lock_available_;
    int nesting_level_;
    ACE_thread_t owner_id_;
};
```

## DESCRIPTION

This implementation is based on an algorithm sketched by Dave Butenhof butenhof@zko.dec.com.  Naturally, I take the credit for any mistakes ;-)

## PUBLIC MEMBERS

```
ACE_thread_mutex_t nesting_mutex_;
```

Guards the state of the nesting level and thread id.

```
ACE_cond_t lock_available_;
```

This condition variable suspends other waiting threads until the mutex is available.

```
int nesting_level_;
```

Current nesting level of the recursion.

```
ACE_thread_t owner_id_;
```

Current owner of the lock.

## AUTHOR

Doug Schmidt schmidt@cs.wustl.edu, Jesper S. M\|ller stophph@diku.dk, and a cast of thousands...

## The ACE\_Sched\_Priority type should be used for platform-

independent thread and process priorities, by convention. int should be used for OS-specific priorities.

## typedef for the \_stat data structure

## Giving unique ACE scoped names for some important

RTSignal-Related constants. Becuase sometimes, different platforms use different names for these constants.

## LIBRARY

ace
