Thank you very much for your response and the link. I realized long ago that sound API callback is probably called not even from a separate thread but from a interrupt service routine that handles the interrupt raised by Palm sound card. What I really need is to prevent Palm OS from unloading my code when another app is about to be launched. In this case I suspect my sound call back will be called as long as playback continues. However, if my code will be unloaded when another app starts and I do not stop playback device freezes. Again, I do not need multithreading beyond what Palm OS 5 already provides. I just need to continue executing my audio playback code after app has exited.
Lock the code resource that holds your callback and use DmProtectDatabase on the database that holds that resource. That should prevent the OS from unlocking your code while it can be called by the OS.
--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
