---
name: "ACE_TPQ_Entry"
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_TPQ_Entry"
---

# ACE\_TPQ\_Entry(3)

Token Proxy Queue entry. Used in the ACE\_Token\_Proxy\_Queue

## NAME

ACE\_TPQ\_Entry -  Token Proxy Queue entry.  Used in the ACE\_Token\_Proxy\_Queue

## SYNOPSIS

```
#include <ace/Local_Tokens.h>
class ACE_TPQ_Entry
{
  public:
    friend class ACE_Token_Manager;
    typedef void (*PTVF) (void *);
    ACE_TPQ_Entry (void);
    ACE_TPQ_Entry (
        const ACE_Token_Proxy *proxy,
        const ASYS_TCHAR *client_id
        );
    ACE_TPQ_Entry (const ACE_TPQ_Entry &rhs);
    ~ACE_TPQ_Entry (void);
    void operator= (const ACE_TPQ_Entry &rhs);
    ACE_Token_Proxy *proxy (void) const;
    void proxy (ACE_Token_Proxy *);
    int nesting_level (void) const;
    void nesting_level (int delta);
    const ASYS_TCHAR *client_id (void) const;
    void client_id (const ASYS_TCHAR *);
    int equal_client_id (const ASYS_TCHAR *id);
    void set (void (*sleep_hook)(void *));
    void sleep_hook (void (*sh)(void *));
    PTVF sleep_hook (void) const;
    void call_sleep_hook (void);
    void dump (void) const;
    ACE_TOKEN_CONST::COND_VAR cond_var_;
    ACE_TOKEN_CONST::MUTEX lock_;
    ACE_TPQ_Entry *next_;
    int waiting (void) const;
    void waiting (int w);
  private:
    int waiting_;
    ACE_Token_Proxy *proxy_;
    int nesting_level_;
    void *arg_;
    ASYS_TCHAR client_id_[ACE_MAXCLIENTIDLEN];
    void (*sleep_hook_)(void *);
};
```

## DESCRIPTION

This file contains definitions for the following classes:

public:\
   7\. ACE\_Token\_Proxy\
   8\. ACE\_Null\_Token : public ACE\_Token\_Proxy\
   9\. ACE\_Local\_Mutex : public ACE\_Token\_Proxy\
   \*. ACE\_Local\_RLock : public ACE\_Local\_Mutex\
   &. ACE\_Local\_WLock : public ACE\_Local\_Mutex private:\
   1\. ACE\_TOKEN\_CONST\
   3\. ACE\_TPQ\_Entry\
   b. ACE\_TSS\_TPQ\_Entry\
   c. ACE\_TPQ\_Iterator\
   4\. ACE\_Token\_Proxy\_Queue\
   5\. ACE\_Tokens\
   6\. ACE\_Mutex\_Token : public ACE\_Tokens\
   12\. ACE\_RW\_Token : public ACE\_Tokens\
   a. ACE\_Token\_Name

 Note that the locking classes defined in this file are \*not\*\
  intended to be used as general-purpose synchronization\
  mechanisms, such as mutexes or semaphores.  Instead, you should\
  use the ACE\_Recursive\_Thread\_Mutex, ACE\_Thread\_Mutex,\
  ACE\_Thread\_Semaphore, etc., that are defined in\
  $ACE\_ROOT/ace/Synch.h and $ACE\_ROOT/ace/Synch\_T.h or the\
  ACE\_Token that's defined in $ACE\_ROOT/ace/Token.h.

## Set/get top of the queue.

```
ACE_Token_Proxy *proxy (void) const;
```

```
void proxy (ACE_Token_Proxy *);
```

## Delta/get nesting level of the entry.

```
int nesting_level (void) const;
```

```
void nesting_level (int delta);
```

## Set/get client\_id of the entry.

```
const ASYS_TCHAR *client_id (void) const;
```

```
void client_id (const ASYS_TCHAR *);
```

```
int equal_client_id (const ASYS_TCHAR *id);
```

Returns 1 if id == client id.  Does not check for id == 0.

```
void set (void (*sleep_hook)(void *));
```

One method for arg and sleep\_hook.

## Set/get sleep hook of the entry.

```
void sleep_hook (void (*sh)(void *));
```

```
PTVF sleep_hook (void) const;
```

```
void call_sleep_hook (void);
```

Call the sleep hook function or method passing arg.

```
void dump (void) const;
```

Dump the state of the class.

## Used to block the thread if an acquire fails with EWOULDBLOCK.

```
ACE_TOKEN_CONST::COND_VAR cond_var_;
```

```
ACE_TOKEN_CONST::MUTEX lock_;
```

```
ACE_TPQ_Entry *next_;
```

Pointer to next in list.

## Get/set whether this client is blocked waiting for a token.

```
int waiting (void) const;
```

```
void waiting (int w);
```

## AUTHOR

Karl-Heinz Dorn kdorn@erlh.siemens.de, Douglas C. Schmidt schmidt@cs.wustl.edu, and Tim Harrison harrison@cs.wustl.edu

## LIBRARY

ace
