You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Dean Gaudet <dg...@hyperreal.com> on 1997/06/16 19:53:16 UTC
cvs commit: apache/src alloc.c http_main.c multithread.h
dgaudet 97/06/16 10:53:15
Modified: src alloc.c http_main.c multithread.h
Log:
Fix the null statement warnings in a manner that avoids hassles should
anyone start checking the return values. Also fix create_mutex() in the
non-multithreaded case in preparation for someone checking the return
values in the multithreaded case. HINT HINT. I would have started checking
the values except I'm not totally sure what to do to report errors.
Revision Changes Path
1.31 +8 -8 apache/src/alloc.c
Index: alloc.c
===================================================================
RCS file: /export/home/cvs/apache/src/alloc.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C3 -r1.30 -r1.31
*** alloc.c 1997/06/16 15:38:54 1.30
--- alloc.c 1997/06/16 17:53:12 1.31
***************
*** 150,156 ****
if (blok == NULL) return; /* Sanity check --- freeing empty pool? */
! acquire_mutex(alloc_mutex);
old_free_list = block_freelist;
block_freelist = blok;
--- 150,156 ----
if (blok == NULL) return; /* Sanity check --- freeing empty pool? */
! (void)acquire_mutex(alloc_mutex);
old_free_list = block_freelist;
block_freelist = blok;
***************
*** 172,178 ****
/* Finally, reset next pointer to get the old free blocks back */
blok->h.next = old_free_list;
! release_mutex(alloc_mutex);
}
--- 172,178 ----
/* Finally, reset next pointer to get the old free blocks back */
blok->h.next = old_free_list;
! (void)release_mutex(alloc_mutex);
}
***************
*** 271,277 ****
block_alarms();
! acquire_mutex(alloc_mutex);
blok = new_block (0);
new_pool = (pool *)blok->h.first_avail;
--- 271,277 ----
block_alarms();
! (void)acquire_mutex(alloc_mutex);
blok = new_block (0);
new_pool = (pool *)blok->h.first_avail;
***************
*** 288,294 ****
p->sub_pools = new_pool;
}
! release_mutex(alloc_mutex);
unblock_alarms();
return new_pool;
--- 288,294 ----
p->sub_pools = new_pool;
}
! (void)release_mutex(alloc_mutex);
unblock_alarms();
return new_pool;
***************
*** 374,386 ****
block_alarms();
! acquire_mutex(alloc_mutex);
blok = new_block (size);
a->last->h.next = blok;
a->last = blok;
! release_mutex(alloc_mutex);
unblock_alarms();
--- 374,386 ----
block_alarms();
! (void)acquire_mutex(alloc_mutex);
blok = new_block (size);
a->last->h.next = blok;
a->last = blok;
! (void)release_mutex(alloc_mutex);
unblock_alarms();
***************
*** 1073,1079 ****
int hStdIn, hStdOut, hStdErr;
int old_priority;
! acquire_mutex(spawn_mutex);
thread_handle = GetCurrentThread(); /* doesn't need to be closed */
old_priority = GetThreadPriority(thread_handle);
SetThreadPriority(thread_handle, THREAD_PRIORITY_HIGHEST);
--- 1073,1079 ----
int hStdIn, hStdOut, hStdErr;
int old_priority;
! (void)acquire_mutex(spawn_mutex);
thread_handle = GetCurrentThread(); /* doesn't need to be closed */
old_priority = GetThreadPriority(thread_handle);
SetThreadPriority(thread_handle, THREAD_PRIORITY_HIGHEST);
***************
*** 1137,1143 ****
}
}
SetThreadPriority(thread_handle, old_priority);
! release_mutex(spawn_mutex);
/*
* go on to the end of the function, where you can
* unblock alarms and return the pid
--- 1137,1143 ----
}
}
SetThreadPriority(thread_handle, old_priority);
! (void)release_mutex(spawn_mutex);
/*
* go on to the end of the function, where you can
* unblock alarms and return the pid
1.152 +5 -1 apache/src/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_main.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -C3 -r1.151 -r1.152
*** http_main.c 1997/06/15 22:27:12 1.151
--- http_main.c 1997/06/16 17:53:13 1.152
***************
*** 130,137 ****
#endif
#endif
-
DEF_Explain
/*
* Actual definitions of config globals... here because this is
--- 130,141 ----
#endif
#endif
DEF_Explain
+
+ #ifndef MULTITHREAD
+ /* this just need to be anything non-NULL */
+ void *dummy_mutex = &dummy_mutex;
+ #endif
/*
* Actual definitions of config globals... here because this is
1.4 +4 -3 apache/src/multithread.h
Index: multithread.h
===================================================================
RCS file: /export/home/cvs/apache/src/multithread.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C3 -r1.3 -r1.4
*** multithread.h 1997/06/16 15:20:16 1.3
--- multithread.h 1997/06/16 17:53:13 1.4
***************
*** 47,56 ****
#define APACHE_TLS
/* Only define the ones actually used, for now */
! #define create_mutex(name) NULL
! #define acquire_mutex(mutex_id) {}
! #define release_mutex(mutex_id) {}
#endif /* ndef MULTITHREAD */
--- 47,57 ----
#define APACHE_TLS
/* Only define the ones actually used, for now */
! extern void *dummy_mutex;
+ #define create_mutex(name) ((mutex *)dummy_mutex)
+ #define acquire_mutex(mutex_id) ((int)MULTI_OK)
+ #define release_mutex(mutex_id) ((int)MULTI_OK)
#endif /* ndef MULTITHREAD */