Add a todo for a POSIX semaphore problem :'(
This commit is contained in:
parent
9e0d3f34f5
commit
bd6267330a
3 changed files with 15 additions and 4 deletions
|
|
@ -35,7 +35,7 @@ else
|
|||
fi
|
||||
|
||||
if test x"${enable_debug}" = x"yes"; then
|
||||
AM_CFLAGS="-Wall -g"
|
||||
AM_CFLAGS="-Wall -g -DDEBUG"
|
||||
else
|
||||
AM_CFLAGS="-Wall -Werror -O2"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ pyfcgi_LDADD = $(PYTHON_LDFLAGS)
|
|||
# libpyfcgi python module
|
||||
lib_LTLIBRARIES = libpyfcgi.la
|
||||
libpyfcgi_la_SOURCES = python_pyfcgi.c python_ioin.c ipc.c monitor.c
|
||||
libpyfcgi_la_CFLAGS = $(PYTHON_SO_CFLAGS)
|
||||
libpyfcgi_la_CFLAGS = $(PYTHON_SO_CFLAGS) $(AM_CFLAGS)
|
||||
libpyfcgi_la_LDFLAGS = $(PYTHON_SO_LDFLAGS)
|
||||
|
||||
# static librarie for check
|
||||
noinst_LIBRARIES = libpyfcgi.a
|
||||
libpyfcgi_a_SOURCES = logger.c pyworker.c responder.c conf.c pyutils.c python_pyfcgi.c python_ioin.c ipc.c monitor.c
|
||||
libpyfcgi_a_CFLAGS = $(PYTHON_CFLAGS)
|
||||
libpyfcgi_a_CFLAGS = $(PYTHON_CFLAGS) $(AM_CFLAGS)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -610,11 +610,22 @@ static void worker_set_busy()
|
|||
{
|
||||
int err;
|
||||
if(!_worker_idle) { return; }
|
||||
/**@todo The pool handler WILL decrement the sem to figure if the pool
|
||||
* is busy -__- Using sem_wait make sure that the worker will be able
|
||||
* to set busy, but it can also freeze if not able to set busy....
|
||||
* sem_timedwait require to get abstime -_- The better way is
|
||||
* maybe to nanosleep 0.01s and retry a sem_trywait... SysV sem are
|
||||
* better T_T
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
if(sem_trywait(PyFCGI_SEM(SEM_WSTATE).sem) < 0)
|
||||
#else
|
||||
if(sem_wait(PyFCGI_SEM(SEM_WSTATE).sem) < 0)
|
||||
#endif
|
||||
{
|
||||
err = errno;
|
||||
if(err == EAGAIN)
|
||||
{//panic
|
||||
{ //panic
|
||||
pyfcgi_log(LOG_ALERT, "Unable to set busy ! WSTATE sem is allready 0 !!!");
|
||||
_worker_idle = 0;
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue