As a callback can interupt my running routine at any time, I have two (lets call it) "threads" reading and writing my custom queue. So I have like two processes and shared memory. So to handle that correctly I would need atomic read-lock operations and stuff, to be able to provide exclusive access to shared variables.
Is anything like that provided by PalmOS? I doubt so. How can one deal with issues like that? Damn that callbacks (sorry for that)!
Thanks, Jan
Peter Easton wrote:
Hi Jan,
A very good question! The best way to handle this is to create your own "event" queue and post a custom event when you add an event to this queue. In your main form loop, when you receive this custom event you should retrieve the BT event from your custom queue. Also in your main event loop, you should poll your custom queue when you receive a winEnter event, in case you missed your custom event while another window was open.
Regards,
Peter
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
