class FenceCollection

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

Manages the events (Fences) imported by a Coordinator client.

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

dispatcher.

Public Methods

void FenceCollection (FenceListener * listener, fdf::UnownedSynchronizedDispatcher dispatcher)

Creates an empty collection.

`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.

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

void Clear ()

Releases the FenceCollection instance's references to all imported events.

Any Fence that has no reference remaining will be destroyed.

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

zx::result<> ImportEvent (zx::event event, display::EventId id)

Adds an event to the set of imported events.

`id` must be valid.

Errors with ZX_ERR_ALREADY_EXISTS if `id` is already assigned to an

imported event. Errors with ZX_ERR_NO_MEMORY if a memory allocation fails.

If successful, passing `id` to `GetFence()` will retrieve the Fence that

manages `event`.

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

void FenceCollection (const FenceCollection & )

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

FenceCollection & operator= (const FenceCollection & )

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

void ~FenceCollection ()

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

void ReleaseEvent (display::EventId id)

Removes an event from the set of imported events.

The method is idempotent. It makes no change if `id` is not assigned to

an imported event.

The call releases the FenceCollection instance's reference to the Fence

managing the imported event. If there are no references remaining, the

Fence will be destroyed.

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

fbl::RefPtr<Fence> GetFence (display::EventId id)

Retrieves the fence managing an imported event.

Returns nullptr if `id` is not assigned to an imported event.

The returned reference can be used to ensure that the fence is not

destroyed (releasing the event and canceling any wait operation) when

`ReleaseEvent()` is called with `id`.

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