From: Jaroslav Kysela Date: Fri, 2 Nov 2007 17:30:20 +0000 (+0100) Subject: allow thread when calling handle events for mixer and hcontrol interface X-Git-Tag: v1.0.16rc1~2 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=11710eeba9f8443126231615103ddf1f707cae34;p=alsa-python.git allow thread when calling handle events for mixer and hcontrol interface --- diff --git a/pyalsa/alsahcontrol.c b/pyalsa/alsahcontrol.c index cda2016..70ce807 100644 --- a/pyalsa/alsahcontrol.c +++ b/pyalsa/alsahcontrol.c @@ -148,7 +148,11 @@ PyDoc_STRVAR(handlevents__doc__, static PyObject * pyalsahcontrol_handleevents(struct pyalsahcontrol *self, PyObject *args) { - int err = snd_hctl_handle_events(self->handle); + int err; + + Py_BEGIN_ALLOW_THREADS; + err = snd_hctl_handle_events(self->handle); + Py_END_ALLOW_THREADS; if (err < 0) PyErr_Format(PyExc_IOError, "HControl handle events error: %s", strerror(-err)); diff --git a/pyalsa/alsamixer.c b/pyalsa/alsamixer.c index 532c249..a2d5097 100644 --- a/pyalsa/alsamixer.c +++ b/pyalsa/alsamixer.c @@ -137,7 +137,11 @@ PyDoc_STRVAR(handlevents__doc__, static PyObject * pyalsamixer_handleevents(struct pyalsamixer *self, PyObject *args) { - int err = snd_mixer_handle_events(self->handle); + int err; + + Py_BEGIN_ALLOW_THREADS; + err = snd_mixer_handle_events(self->handle); + Py_END_ALLOW_THREADS; if (err < 0) PyErr_Format(PyExc_IOError, "Alsamixer handle events error: %s", strerror(-err));