Package: glib

Function glib:source-ready-time

Lambda List

glib:source-ready-time (source)

Syntax

(g:source-ready-time source) => time
(setf (g:source-readey-time source) time)

Arguments

source -- a g:source instance
time -- an integer with the monotonic time at which the source will be ready, 0 for "immediately", -1 for "never"

Details

The g:source-ready-time function gets the "ready time" of the source. Any time before the current monotonic time, including 0, is an indication that the source will fire immediately. The (setf g:source-ready-time) function sets a source to be dispatched when the given monotonic time is reached (or passed). If the monotonic time is in the past, as it always will be if time is 0, then the source will be dispatched immediately. If time is -1 then the source is never woken up on the basis of the passage of time. Dispatching the source does not reset the ready time. You should do so yourself, from the source dispatch function.

Note that if you have a pair of sources where the ready time of one suggests that it will be delivered first but the priority for the other suggests that it would be delivered first, and the ready time for both sources is reached during the same main context iteration then the order of dispatch is undefined.
 

See also

2024-11-6