Changeset 1946
- Timestamp:
- 04/21/08 12:05:09
- Files:
-
- branches/769-unixwait/cherrypy/process/unix_threading/Makefile (added)
- branches/769-unixwait/cherrypy/process/unix_threading/__init__.py (modified) (1 diff)
- branches/769-unixwait/cherrypy/process/unix_threading/_native_event.py (added)
- branches/769-unixwait/cherrypy/process/unix_threading/_pthread_cond.c (modified) (1 diff)
- branches/769-unixwait/cherrypy/process/unix_threading/test.py (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/769-unixwait/cherrypy/process/unix_threading/__init__.py
r1945 r1946 1 import threading 2 from unix_threading import _pthread_cond 1 from _native_event import NativeEvent 3 2 4 class NativeEvent(threading._Event):5 def __init__(self):6 threading._Event.__init__(self)7 self.__cond = _pthread_cond.Condition()8 branches/769-unixwait/cherrypy/process/unix_threading/_pthread_cond.c
r1945 r1946 120 120 int err = 0; 121 121 while( !self->set && err != EINVAL ) { 122 /* struct timespec timeout = {0}; 123 timeout.tv_sec = time(0) + 4; 124 125 Py_BEGIN_ALLOW_THREADS; 126 err = pthread_cond_timedwait( &self->cond, &self->lock, &timeout ); 127 Py_END_ALLOW_THREADS; 128 */ 122 129 Py_BEGIN_ALLOW_THREADS; 123 130 err = pthread_cond_wait( &self->cond, &self->lock ); 124 131 Py_END_ALLOW_THREADS; 132 if( PyErr_CheckSignals() ) { 133 return NULL; 134 } 125 135 } 126 136 if( err != 0 ) {

