Changeset 945 for pjproject/trunk


Ignore:
Timestamp:
Feb 14, 2007 2:15:19 AM (18 years ago)
Author:
bennylp
Message:

Fixed ticket #93: Python readline() blocks/hang because C module running on different thread is calling a blocking OS call

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/py_pjsua/py_pjsua.c

    r944 r945  
    21642164        return NULL; 
    21652165    } 
     2166 
     2167    /* Since handle_events() will block, we must wrap it with ALLOW_THREADS 
     2168     * construct, or otherwise many Python blocking functions (such as 
     2169     * time.sleep(), readline(), etc.) may hang/block indefinitely. 
     2170     * See http://www.python.org/doc/current/api/threads.html for more info. 
     2171     */ 
     2172    Py_BEGIN_ALLOW_THREADS 
    21662173    ret = pjsua_handle_events(msec); 
     2174    Py_END_ALLOW_THREADS 
    21672175     
    21682176    return Py_BuildValue("i",ret); 
Note: See TracChangeset for help on using the changeset viewer.