Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SharedTimerRef

A Shared Timer that can be used to share a single timer object with multiple owners.

Hierarchy

Index

Constructors

constructor

  • This constructor is an implementation detail. Do not use this.

    Parameters

    • ptr: number

    Returns SharedTimerRef

Properties

ptr

ptr: number

Methods

read

  • Requests read access to the timer that is being shared. This blocks the thread as long as there is an active write lock. Dispose the read lock when you are done using the timer.

    Returns TimerReadLock

readWith

  • readWith<T>(action: (timer: TimerRef) => T): T
  • Type parameters

    • T

    Parameters

    Returns T

replaceInner

  • replaceInner(timer: Timer): void
  • Replaces the timer that is being shared by the timer provided. This blocks the thread as long as there are active write or read locks. Everyone who is sharing the old timer will share the provided timer after successful completion.

    Parameters

    Returns void

share

  • Creates a new shared timer handle that shares the same timer. The inner timer object only gets disposed when the final handle gets disposed.

    Returns SharedTimer

write

  • Requests write access to the timer that is being shared. This blocks the thread as long as there are active write or read locks. Dispose the write lock when you are done using the timer.

    Returns TimerWriteLock

writeWith

Generated using TypeDoc