Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1946

Show
Ignore:
Timestamp:
04/21/08 12:05:09
Author:
dan
Message:

checking signals

Files:

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 
     1from _native_event import NativeEvent 
    32 
    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  
    120120  int err = 0; 
    121121  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    */ 
    122129    Py_BEGIN_ALLOW_THREADS; 
    123130    err = pthread_cond_wait( &self->cond, &self->lock ); 
    124131    Py_END_ALLOW_THREADS; 
     132    if( PyErr_CheckSignals() ) { 
     133      return NULL; 
     134    } 
    125135  } 
    126136  if( err != 0 ) { 

Hosted by WebFaction

Log in as guest/cpguest to create tickets