class Fence

Defined at line 61 of file ../../src/graphics/display/drivers/coordinator/fence.h

Manages an event imported by a Coordinator client.

The class currently uses Vulkan terminology, rather than Fuchsia event

terminology.

Fences are reference-counted. When all the references are dropped, the any

pending wait operation is canceled, and the event is released.

Instances are not thread-safe and must be accessed on a single synchronized

dispatcher.

Public Methods

void Fence (FenceListener * listener, fdf::UnownedSynchronizedDispatcher dispatcher, display::EventId id, zx::event event)

`listener` methods are called on `dispatcher`. `listener`

must not be null and must outlive the newly created instance.

`dispatcher` must not be null and must outlive the newly created instance.

The instance must be accessed exclusively on the dispatcher.

`id` and `event` must be valid.

Defined at line 67 of file ../../src/graphics/display/drivers/coordinator/fence.cc

void Fence (const Fence & )

Defined at line 75 of file ../../src/graphics/display/drivers/coordinator/fence.h

Fence & operator= (const Fence & )

Defined at line 76 of file ../../src/graphics/display/drivers/coordinator/fence.h

void ~Fence ()

Defined at line 87 of file ../../src/graphics/display/drivers/coordinator/fence.cc

zx::result<> Wait ()

Brings the fence in the waited-for state.

Signaling a waited-for fence's event causes a call to

`FenceListener::OnFenceSignaled()`.

This method is idempotent. It makes no change if the fence is already

waited-for.

The wait operation is automatically canceled when a waited-for fence is

destroyed. This can be avoided by holding a reference to the fence while

waiting for it to be signaled.

Defined at line 35 of file ../../src/graphics/display/drivers/coordinator/fence.cc

void Signal ()

Signals the fence's underlying event.

Defined at line 29 of file ../../src/graphics/display/drivers/coordinator/fence.cc