From 11710eeba9f8443126231615103ddf1f707cae34 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 2 Nov 2007 18:30:20 +0100 Subject: [PATCH] allow thread when calling handle events for mixer and hcontrol interface --- pyalsa/alsahcontrol.c | 6 +++++- pyalsa/alsamixer.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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)); -- 2.47.1