I'm using Timer as an process interrupt mechanism. The flow of logic is as follows:
T0: create new timer at T0 and schedule a new timer task to execute at T2 (1 second task delay, task is very simple - sets a flag variable)
T1: in the main calling thread, sleep for 5 seconds
T2: in the timer thread, task executes
T5: sleep finishes
T6: cancel timer and any scheduled tasks
The code works perfectly on my Windows and Ubuntu dev environment. But when I run the same code on my SLES 10 build server, logging indicates this execution order:
T0: timer and timer tasks are created to execute at T2
T1: main thread sleeps for 5 seconds
T5: main thread wakes up
T6: timer cancels
T7: task executes
Could anyone offer an explanation as to why this occurs? Thanks very much.