[Python-checkins] python/dist/src/Modules ossaudiodev.c,1.27,1.28
gward@users.sourceforge.net
gward@users.sourceforge.net
Mon, 26 May 2003 15:47:33 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv23816
Modified Files:
ossaudiodev.c
Log Message:
Release the GIL in two more methods:
* 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()
Index: ossaudiodev.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/ossaudiodev.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** ossaudiodev.c 23 May 2003 01:50:37 -0000 1.27
--- ossaudiodev.c 26 May 2003 22:47:30 -0000 1.28
***************
*** 354,358 ****
oss_sync(oss_audio_t *self, PyObject *args)
{
! return _do_ioctl_0(self->fd, args, "sync", SNDCTL_DSP_SYNC);
}
--- 354,363 ----
oss_sync(oss_audio_t *self, PyObject *args)
{
! int rv;
!
! Py_BEGIN_ALLOW_THREADS
! rv = _do_ioctl_0(self->fd, args, "sync", SNDCTL_DSP_SYNC);
! Py_END_ALLOW_THREADS
! return rv;
}
***************
*** 479,483 ****
--- 484,490 ----
if (self->fd >= 0) {
+ Py_BEGIN_ALLOW_THREADS
close(self->fd);
+ Py_END_ALLOW_THREADS
self->fd = -1;
}