Table of Contents

Struct Wake

Namespace
Maplibre.NativeFfi
Assembly
Maplibre.NativeFfi.dll

A callback that tells the caller when work is ready.

public readonly record struct Wake : IEquatable<Wake>
Implements
Inherited Members

Remarks

Can run on any thread, including the caller's own thread during a library call. Return quickly and don't block.

See mln_wake in the C API reference.

Constructors

Wake(WakeCallback?)

A callback that tells the caller when work is ready.

public Wake(WakeCallback? Callback)

Parameters

Callback WakeCallback

Null to turn the wake off.

Remarks

Can run on any thread, including the caller's own thread during a library call. Return quickly and don't block.

See mln_wake in the C API reference.

Properties

Callback

Null to turn the wake off.

public WakeCallback? Callback { get; init; }

Property Value

WakeCallback

Methods

Native(NativePointer, NativePointer, NativePointer)

Creates a native registration from C functions and a context that the host supplies. The binding copies them unchanged, so native code calls each function without entering the .NET runtime.

public static Wake Native(NativePointer callback, NativePointer userData, NativePointer releaseUserData)

Parameters

callback NativePointer

The C function that native code calls as callback.

userData NativePointer

The context that native code passes to each function.

releaseUserData NativePointer

The C function that releases userData, or Null.

Returns

Wake

Remarks

The first call that carries this value or a copy of it consumes the registration. Native code releases the context of a call that it accepts, and the binding calls the release for a call that native code does not accept. A later call that carries the registration throws an invalid-state MaplibreException before it reaches native code.