May 26, 2006
2 a.m.
Alexandre Julliard wrote:
Emmanuel Maillard <mahanuu(a)opendarwin.org> writes:
All callback used by CoreAudio/AudioUnit are call from a thread created by CoreAudio. Its why i can't use debug channels, critical section and call DriverCallback directly ...
Yes, you can't do much without a valid thread. That's really a broken API if you ask me... Anyway, please remove the #ifdefs, and add comments to the functions that run in a foreign thread to ensure that no one tries to call Windows APIs from there.
Well, given the demands of real-time programming, such a design is to be expected. It's called an interrupt. If you want to run code on your own thread, create it and block on a semaphore. The interrupt sets the semaphore and returns. Jim