class

Tryst::Notifier::ThreadState

Inherits Reference < Object

One per Tcl-using OS thread, exactly mirroring Tcl's own TCL_TSD_INIT/ThreadSpecificData model - CreateFileHandler/ DeleteFileHandler/WaitForEvent receive no clientData at all (only FinalizeNotifier/AlertNotifier do, from whatever InitNotifier returned), so identifying "which thread" for those three has to go through Thread.current, the same way Tcl's own reference notifiers do internally.

Constructors

Instance methods

alert_fd
alert_read

Kept alive as an ivar, not a discarded local: IO.pipe's own wrapper objects default to close_on_finalize: true, so a discarded local would eventually get GC'd and close the real fd out from under @alert_fd. Only .close (FinalizeNotifier) and .fd (below) are ever used on these two directly - actual readiness checks go through #alert_fd via raw poll(2), not through these IO objects.

alert_write
handlers
handlers_dirty
handlers_dirty=(handlers_dirty : Bool)
poll_fds
poll_fds=(poll_fds : Array(Int32))
pollfds

poll_once's own buffers, cached here so the steady-state (nothing registered/unregistered since the last call) path is allocation- free - rebuilt only when create/delete_file_handler flips handlers_dirty. poll_fds is parallel to pollfds (same index), carrying -1 for the alert-fd sentinel entry - see poll_once.

pollfds=(pollfds : Array(LibPoll::Pollfd))

poll_once's own buffers, cached here so the steady-state (nothing registered/unregistered since the last call) path is allocation- free - rebuilt only when create/delete_file_handler flips handlers_dirty. poll_fds is parallel to pollfds (same index), carrying -1 for the alert-fd sentinel entry - see poll_once.