template <typename Domain = void>

class CapabilityToken

Defined at line 101 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/capability_token.h

A capability token that may be acquired/released by the given Domain type. The Domain type is

responsible for performing the actions or checks required to actually acquire/release the

capability.

Example:

class Foo; // Forward declaration.

constexpr concurrent::CapabilityToken

<Foo

> foo_token;

class Foo {

public:

void Acquire() __TA_ACQUIRE(foo_token) {

// Operations necessary to to acquire the token...

foo_token.Acquire();

}

void Release() __TA_RELEASE(foo_token) {

// Operations necessary to to release the token...

foo_token.Release();

}

};

Public Methods

void CapabilityToken<Domain> ()

Defined at line 103 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/capability_token.h

void ~CapabilityToken<Domain> ()

Defined at line 104 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/capability_token.h

void CapabilityToken<Domain> (const CapabilityToken<Domain> & )

Defined at line 106 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/capability_token.h

CapabilityToken<Domain> & operator= (const CapabilityToken<Domain> & )

Defined at line 107 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/capability_token.h

void CapabilityToken<Domain> (CapabilityToken<Domain> && )

Defined at line 108 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/capability_token.h

CapabilityToken<Domain> & operator= (CapabilityToken<Domain> && )

Defined at line 109 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/capability_token.h

void AssertHeld ()

Asserts that the capability is held, if supported by the Domain type.

May only be called if the Domain type implements a method with the following signature to

perform the actual runtime assertion logic:

static void Domain::AssertCapabilityHeld(CapabilityToken

<Domain

>::TagType)

Defined at line 122 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/capability_token.h

Enumerations

enum TagType
Name Value
Tag 0

A tag type passed to Domain::AssertCapabilityHeld, if provided by the Domain type, to avoid

potential collisions with unrelated methods of the same name.

Defined at line 113 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/capability_token.h

Records