* sync(), because it waits for hardware buffers to flush, which
can take several seconds depending on cirumstances (according
to the OSS docs)
* close(), because it does an implicit sync()
static PyObject *
oss_sync(oss_audio_t *self, PyObject *args)
{
- return _do_ioctl_0(self->fd, args, "sync", SNDCTL_DSP_SYNC);
+ int rv;
+
+ Py_BEGIN_ALLOW_THREADS
+ rv = _do_ioctl_0(self->fd, args, "sync", SNDCTL_DSP_SYNC);
+ Py_END_ALLOW_THREADS
+ return rv;
}
static PyObject *
return NULL;
if (self->fd >= 0) {
+ Py_BEGIN_ALLOW_THREADS
close(self->fd);
+ Py_END_ALLOW_THREADS
self->fd = -1;
}
Py_INCREF(Py_None);