Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sol.ctr.columbia.edu!src.honeywell.com!msi.umn.edu!sctc.com!pasturel From: pasturel@sctc.com (Pierre Pasturel) Newsgroups: comp.windows.x.motif Subject: delay loop Summary: how to resume execution after x msec Keywords: XtAddTimeOut Message-ID: <1990Dec13.170905.21902@sctc.com> Date: 13 Dec 90 17:09:05 GMT Distribution: comp.windows.x.motif comp.windows.x Organization: Secure Computing Technology Corporation Lines: 40 I want to use XtAddTimeOut to cause a delay X in msec in a callback by doing this: /*** in callback timer_id = XtAddTimeOut(X,delay_done,NULL); while ( done == FALSE ) { } /* rest of processing in callback */ *** end of callback ***/ void delay_done(caddr_t client) { done = TRUE; } where delay_done is the processing procedure which will set the done flag to TRUE when X msecs have expired. The problem is, the while loop sits in a tight loop forever and the Time Out never occurs. Do you know what I can do? I want to set it up so that processing occurs AFTER the while loop, not in delay_done. Thanks for any help Pierre pasturel@sctc.com p.s. I tried using setjmp and longjmp, but I would rather stay away from those.