php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #63748
Patch bug63748.patch revision 2012-12-12 06:56 UTC by laruence@php.net
revision 2012-12-12 06:54 UTC by laruence@php.net

Patch bug63748.patch for FPM related Bug #63748

Patch version 2012-12-12 06:56 UTC

Return to Bug #63748 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: laruence@php.net

diff --git a/sapi/fpm/fpm/fpm_scoreboard.c b/sapi/fpm/fpm/fpm_scoreboard.c
index 24463a9..d6b23e6 100644
--- a/sapi/fpm/fpm/fpm_scoreboard.c
+++ b/sapi/fpm/fpm/fpm_scoreboard.c
@@ -84,7 +84,7 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request
 	}
 
 
-	fpm_spinlock(&scoreboard->lock, 0);
+	fpm_spinlock(&scoreboard->u.lock, 0);
 	if (action == FPM_SCOREBOARD_ACTION_SET) {
 		if (idle >= 0) {
 			scoreboard->idle = idle;
@@ -143,7 +143,7 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request
 		scoreboard->active_max = scoreboard->active;
 	}
 
-	fpm_unlock(scoreboard->lock);
+	fpm_unlock(scoreboard->u.lock);
 }
 /* }}} */
 
@@ -184,7 +184,7 @@ struct fpm_scoreboard_s *fpm_scoreboard_acquire(struct fpm_scoreboard_s *scorebo
 		return NULL;
 	}
 
-	if (!fpm_spinlock(&s->lock, nohang)) {
+	if (!fpm_spinlock(&s->u.lock, nohang)) {
 		return NULL;
 	}
 	return s;
@@ -196,7 +196,7 @@ void fpm_scoreboard_release(struct fpm_scoreboard_s *scoreboard) {
 		return;
 	}
 
-	scoreboard->lock = 0;
+	scoreboard->u.lock = 0;
 }
 
 struct fpm_scoreboard_proc_s *fpm_scoreboard_proc_acquire(struct fpm_scoreboard_s *scoreboard, int child_index, int nohang) /* {{{ */
@@ -208,7 +208,7 @@ struct fpm_scoreboard_proc_s *fpm_scoreboard_proc_acquire(struct fpm_scoreboard_
 		return NULL;
 	}
 
-	if (!fpm_spinlock(&proc->lock, nohang)) {
+	if (!fpm_spinlock(&proc->u.lock, nohang)) {
 		return NULL;
 	}
 
@@ -222,7 +222,7 @@ void fpm_scoreboard_proc_release(struct fpm_scoreboard_proc_s *proc) /* {{{ */
 		return;
 	}
 
-	proc->lock = 0;
+	proc->u.lock = 0;
 }
 
 void fpm_scoreboard_free(struct fpm_scoreboard_s *scoreboard) /* {{{ */
diff --git a/sapi/fpm/fpm/fpm_scoreboard.h b/sapi/fpm/fpm/fpm_scoreboard.h
index f58a287..cc4f247 100644
--- a/sapi/fpm/fpm/fpm_scoreboard.h
+++ b/sapi/fpm/fpm/fpm_scoreboard.h
@@ -21,7 +21,7 @@ struct fpm_scoreboard_proc_s {
 	union {
 		atomic_t lock;
 		char dummy[16];
-	};
+	}u;
 	int used;
 	time_t start_epoch;
 	pid_t pid;
@@ -50,7 +50,7 @@ struct fpm_scoreboard_s {
 	union {
 		atomic_t lock;
 		char dummy[16];
-	};
+	}u;
 	char pool[32];
 	int pm;
 	time_t start_epoch;
diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c
index 2363b57..babe872 100644
--- a/sapi/fpm/fpm/fpm_status.c
+++ b/sapi/fpm/fpm/fpm_status.c
@@ -92,7 +92,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 			return 1;
 		}
 
-		if (!fpm_spinlock(&scoreboard_p->lock, 1)) {
+		if (!fpm_spinlock(&scoreboard_p->u.lock, 1)) {
 			zlog(ZLOG_NOTICE, "[pool %s] status: scoreboard already in used.", scoreboard_p->pool);
 			SG(sapi_headers).http_response_code = 503;
 			sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC);
@@ -103,7 +103,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 		}
 		/* copy the scoreboard not to bother other processes */
 		scoreboard = *scoreboard_p;
-		fpm_unlock(scoreboard_p->lock);
+		fpm_unlock(scoreboard_p->u.lock);
 
 		if (scoreboard.idle < 0 || scoreboard.active < 0) {
 			zlog(ZLOG_ERROR, "[pool %s] invalid status values", scoreboard.pool);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC