mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Improve style in examples.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1682979 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -91,7 +91,8 @@ typedef struct exipc_data {
|
||||
* on restarts. It assures that the new children will not talk to a stale
|
||||
* shared memory segment.
|
||||
*/
|
||||
static apr_status_t shm_cleanup_wrapper(void *unused) {
|
||||
static apr_status_t shm_cleanup_wrapper(void *unused)
|
||||
{
|
||||
if (exipc_shm)
|
||||
return apr_shm_destroy(exipc_shm);
|
||||
return OK;
|
||||
@@ -248,10 +249,12 @@ static int exipc_handler(request_rec *r)
|
||||
rs = apr_global_mutex_trylock(exipc_mutex);
|
||||
if (APR_STATUS_IS_EBUSY(rs)) {
|
||||
apr_sleep(CAMPOUT);
|
||||
} else if (APR_SUCCESS == rs) {
|
||||
}
|
||||
else if (APR_SUCCESS == rs) {
|
||||
gotlock = 1;
|
||||
break; /* Get out of the loop */
|
||||
} else if (APR_STATUS_IS_ENOTIMPL(rs)) {
|
||||
}
|
||||
else if (APR_STATUS_IS_ENOTIMPL(rs)) {
|
||||
/* If it's not implemented, just hang in the mutex. */
|
||||
startcamp = apr_time_now();
|
||||
rs = apr_global_mutex_lock(exipc_mutex);
|
||||
@@ -259,21 +262,23 @@ static int exipc_handler(request_rec *r)
|
||||
if (APR_SUCCESS == rs) {
|
||||
gotlock = 1;
|
||||
break; /* Out of the loop */
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
/* Some error, log and bail */
|
||||
ap_log_error(APLOG_MARK, APLOG_ERR, rs, r->server,
|
||||
"Child %ld failed to acquire lock",
|
||||
(long int)getpid());
|
||||
break; /* Out of the loop without having the lock */
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
/* Some other error, log and bail */
|
||||
ap_log_error(APLOG_MARK, APLOG_ERR, rs, r->server,
|
||||
"Child %ld failed to try and acquire lock",
|
||||
(long int)getpid());
|
||||
break; /* Out of the loop without having the lock */
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* The only way to get to this point is if the trylock worked
|
||||
* and returned BUSY. So, bump the time and try again
|
||||
@@ -307,7 +312,8 @@ static int exipc_handler(request_rec *r)
|
||||
ap_rprintf(r, "<tr><td>Counter:</td><td>%u</td></tr>\n",
|
||||
(unsigned int)base->counter);
|
||||
ap_rputs("</table>\n", r);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* Send a page saying that we couldn't get the lock. Don't say
|
||||
* what the counter is, because without the lock the value could
|
||||
@@ -348,4 +354,3 @@ AP_DECLARE_MODULE(example_ipc) = {
|
||||
NULL, /* table of config file commands */
|
||||
exipc_register_hooks /* register hooks */
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user