Author: mladen.turk(a)jboss.com
Date: 2008-05-29 04:20:30 -0400 (Thu, 29 May 2008)
New Revision: 1637
Modified:
sandbox/aloha/httpd/modules/manager/mm_asmm.c
Log:
Add sections on maintain instead close/open
Modified: sandbox/aloha/httpd/modules/manager/mm_asmm.c
===================================================================
--- sandbox/aloha/httpd/modules/manager/mm_asmm.c 2008-05-29 07:50:46 UTC (rev 1636)
+++ sandbox/aloha/httpd/modules/manager/mm_asmm.c 2008-05-29 08:20:30 UTC (rev 1637)
@@ -649,7 +649,7 @@
static apr_status_t add_slotmem_segment(asmm_slotmem_t *mem)
{
- apr_status_t rv;
+ apr_status_t rv = APR_SUCCESS;
apr_uint16_t n;
asmm_mem_data_t *bmp = NULL;
asmm_mem_data_t *p = NULL;
@@ -852,14 +852,25 @@
apr_status_t asmm_slotmem_maintain(asmm_slotmem_t *mem)
{
apr_status_t rv = APR_SUCCESS;
- if (mem && mem->sections->hdr->flags & ASMM_NEW_SECTION) {
- if (mem->lock)
- (void)apr_global_mutex_lock(mem->lock);
- rv = new_slotmem_segment(mem);
- mem->sections->hdr->flags &= ~ASMM_NEW_SECTION;
- if (mem->lock)
- (void)apr_global_mutex_unlock(mem->lock);
+
+ if (!mem || !mem->sections)
+ return APR_ENOMEM;
+ if (mem->maxsections) {
+ if (mem->sections->hdr->flags & ASMM_NEW_SECTION) {
+ _ASMM_VLOCK(mem);
+ rv = new_slotmem_segment(mem);
+ mem->sections->hdr->flags &= ~ASMM_NEW_SECTION;
+ _ASMM_UNLOCK(mem);
+ }
}
+ else {
+ /* Opened memory */
+ if (mem->sections->hdr->timestamp != mem->timestamp) {
+ _ASMM_VLOCK(mem);
+ rv = add_slotmem_segment(mem);
+ _ASMM_UNLOCK(mem);
+ }
+ }
return rv;
}
Show replies by date