The first two synchronize differently than the X11/Xt event loops:
The CDAQTCLProcessor jackets the call to CDAQTCLProcessor::operator() with a lock and unlock of the global serialization mutex. This forces the command's execution to be synchronized to the application.
There may be some application specific scripts which require syncronization to the application (for example modification of related variables). The sync command can be added to the interpreter by instantiating and registering an instance of a CTCLSynchronizeCommand. The sync command allows a script to be syncronized to the application. For example:
sync { ;# Synchronized script begins. set var1 $thing set var2 [Relationship $var1] } ;# Synchronized script ends.
The CXtEventLoop encapsulates an event loop which brackets the dispatch of a GUI event with synchronization calls. The main loop for examples looks like:
while(1) { XtGetEvent() LockMutex() XtDispatchEvent(); UnlockMutex(); yield(); // Let someone else run. }
The call to LockMutex() enters application synchronized code. After this call the GUI event is dispatched to its application specific callback via the call to XtDispatchEvent(). On return, UnlockMutex() marks the end of syncronized execution.