ssfrr / AudioIO.jl

[UNMAINTAINED] - Simple Audio IO in Julia
MIT License
61 stars 24 forks source link

Semaphore seems to be getting double-waited #22

Closed ssfrr closed 10 years ago

ssfrr commented 10 years ago

Currently only tested on my Linux machine, using PortAudio -> Alsa -> PulseAudio -> JACK.

Once in a while I'm seeing that the semaphore is at 0 even after the sem_post call, implying that sem_wait was called twice. I'm not sure if the callback is getting called reentrantly by the audio system or what.

The cpu_usage branch has a printf whenever the semaphore is not what it's supposed to be. I'd be interested to see if this happens on other platforms as well. I'll test on OSX tonight.

ssfrr commented 10 years ago

nevermind, I think this was just a race condition in my testing code, where by the time I checked the value of the semaphore the callback had already run again and re-waited.