various condition build fixes

This commit is contained in:
roberto@cable
2012-02-25 08:34:11 +01:00
parent c95ec82b03
commit 9bbef9b0c5
3 changed files with 21 additions and 3 deletions
+1 -1
View File
@@ -40,9 +40,9 @@ void *simple_loop(void *arg1) {
long core_id = (long) arg1;
struct wsgi_request *wsgi_req = uwsgi.wsgi_requests[core_id];
int i;
#ifdef UWSGI_THREADING
int i;
//PyThreadState *pts;
sigset_t smask;
+15 -1
View File
@@ -2,14 +2,28 @@ import os
NAME='php'
ld_run_path = None
PHPPATH = 'php-config'
try:
phpdir = os.environ['UWSGICONFIG_PHPDIR']
ld_run_path = "%s/lib" % phpdir
PHPPATH = "%s/bin/php-config" % phpdir
except:
pass
try:
PHPPATH = os.environ['UWSGICONFIG_PHPPATH']
except:
PHPPATH = 'php-config'
pass
CFLAGS = [os.popen(PHPPATH + ' --includes').read().rstrip()]
LDFLAGS = os.popen(PHPPATH + ' --ldflags').read().rstrip().split()
if ld_run_path:
LDFLAGS.append('-L%s' % ld_run_path)
os.environ['LD_RUN_PATH'] = ld_run_path
LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp5']
GCC_LIST = ['php_plugin']
+5 -1
View File
@@ -500,11 +500,11 @@ void wait_for_threads() {
void gracefully_kill(int signum) {
struct wsgi_request *wsgi_req = current_wsgi_req();
uwsgi_log("Gracefully killing worker %d (pid: %d)...\n", uwsgi.mywid, uwsgi.mypid);
uwsgi.workers[uwsgi.mywid].manage_next_request = 0;
#ifdef UWSGI_THREADING
struct wsgi_request *wsgi_req = current_wsgi_req();
if (uwsgi.threads > 1) {
wait_for_threads();
if (!uwsgi.core[wsgi_req->async_id]->in_request) {
@@ -3035,6 +3035,7 @@ void uwsgi_ignition() {
if (uwsgi.zeromq && uwsgi.async < 2 && !uwsgi.sockets->next) {
if (uwsgi.threads > 1) {
#ifdef UWSGI_THREADING
if (pthread_key_create(&uwsgi.tur_key, NULL)) {
uwsgi_error("pthread_key_create()");
exit(1);
@@ -3043,6 +3044,7 @@ void uwsgi_ignition() {
long j = i;
pthread_create(&uwsgi.core[i]->thread_id, &uwsgi.threads_attr, zeromq_loop, (void *) j);
}
#endif
}
long y = 0;
@@ -3053,6 +3055,7 @@ void uwsgi_ignition() {
if (uwsgi.threads > 1) {
#endif
#ifdef UWSGI_THREADING
if (pthread_key_create(&uwsgi.tur_key, NULL)) {
uwsgi_error("pthread_key_create()");
exit(1);
@@ -3061,6 +3064,7 @@ void uwsgi_ignition() {
long j = i;
pthread_create(&uwsgi.core[i]->thread_id, &uwsgi.threads_attr, simple_loop, (void *) j);
}
#endif
}
if (uwsgi.async < 2) {