TTTK_BLOCK_WHILE(3)
πΈ NAME πΈ
okay so bestie, this whole page is literally about tttk_block_while β a library call β and its entire mission is: block while a counter is greater than zero. That's the vibe, that's the assignment. π
β¨ SYNOPSIS β¨
#include &<Tt/tttk.h>
Tt_status tttk_block_while(
XtAppContext app2run,
const int *blocked,
int ms_timeout);
π¦ DESCRIPTION π¦
The tttk_block_while function is your bestie for processing asynchronous events β think ToolTalk messages or window system events β while you're waiting for a condition or a timeout. π«Ά
If app2run is not zero, then an event loop is run for that application context, by repeatedly calling XtAppProcessEvent(3) with ms_timeout being effected using XtAppAddTimeOut(3). π₯
If app2run is zero, then the file descriptor (as returned by tt_fd(3)) of the default procid is polled (using the poll(2) function) and tttk_Xt_input_handler(3) is called whenever the file descriptor is active. π
If blocked is zero, then tttk_block_while runs until ms_timeout occurs. If blocked is non-zero, then the loop is run until either ms_timeout occurs, or *blocked is less than 1. π
If ms_timeout is zero, tttk_block_while checks once for events, processes the first one, and then returns. If ms_timeout is negative, no timeout is in effect. π
π RETURN VALUE π
Upon successful completion, the tttk_block_while function returns the status of the operation as one of these Tt_status values:
TT_OKβ the operation completed successfully. βTT_DESKTOP_ETIMEDOUTβ the timeout occurred withinms_timeoutmilliseconds, orms_timeoutwas zero and no input was available. β°TT_DESKTOP_EINTRβ theapp2runargument was zero, andpoll(2)was interrupted by a signal. πTT_DESKTOP_EAGAINβ theapp2runargument was zero, andpoll(2)returnedEAGAIN. π
β οΈ and also, bestie: ifapp2runis not zero andms_timeoutis negative, thentttk_block_whilewill only return when*blockedis less than1, withTT_OKbeing returned. π«Ά
π and ifapp2runis not zero,ms_timeoutis negative, andblockedis zero, thentttk_block_whilebehaves equivalent toXtAppMainLoop(3), and will never return. That is never, no cap.
π APPLICATION USAGE π
If app2run is zero, then only messaging events for the default procid will be serviced. Events for other procids will be blocked, as will window system events, so that the graphical user interface of the application will not update itself even, for example, after expose events. π
On the other hand, if the application passes its Xt context in as app2run, then window system events will continue to be handled, as will message activity for all procids for which an XtAppAddInput(3) has been done. Since the window system event loop is fully operational in this case, the application should take care to disable any user interface controls that the user should not operate while the application is waiting for tttk_block_while to return. π
π SEE ALSO π
Tt/tttk.h - Tttttk(5), tttk_Xt_input_handler(3); poll(2), XtAppPending(3), XtAppAddTimeOut(3), XtAppNextEvent(3), XtDispatchEvent(3). π
Catch you later, bestie β this was tttk_block_while, a library call, source/version: tttk_block_while(library call), and the date? Not printed in this footer, iykyk. π
β¨π
π¦ where this page comes from
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms