what is the preferred way to wait while polling a flag



In GTK+ 2.20, what is the preferred way to wait while polling a flag in
shared memory every 25 milliseconds in code something like this?


gint n;
for( n=10; n && (sharedMemory->flag != 1), n--) {


/* wait 25 milliseconds */

}


if( n == 0 ) {

g_warning("Timed out while waiting for flag");

 return 0;

 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]