You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2003/11/16 02:51:28 UTC
cvs commit: httpd-2.0/server/mpm/winnt child.c
trawick 2003/11/15 17:51:28
Modified: modules/experimental mod_mem_cache.c
server/mpm/experimental/leader leader.c
server/mpm/winnt child.c
Log:
stop using deprecated apr_atomic functions
Revision Changes Path
1.95 +11 -11 httpd-2.0/modules/experimental/mod_mem_cache.c
Index: mod_mem_cache.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_mem_cache.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- mod_mem_cache.c 11 Sep 2003 14:56:03 -0000 1.94
+++ mod_mem_cache.c 16 Nov 2003 01:51:27 -0000 1.95
@@ -168,7 +168,7 @@
mem_cache_object_t *mobj = obj->vobj;
#ifdef USE_ATOMICS
- apr_atomic_set(&mobj->pos, pos);
+ apr_atomic_set32(&mobj->pos, pos);
#else
mobj->pos = pos;
#endif
@@ -179,7 +179,7 @@
mem_cache_object_t *mobj = obj->vobj;
#ifdef USE_ATOMICS
- return apr_atomic_read(&mobj->pos);
+ return apr_atomic_read32(&mobj->pos);
#else
return mobj->pos;
#endif
@@ -213,7 +213,7 @@
* condition. A similar pattern is used in remove_url()
*/
#ifdef USE_ATOMICS
- apr_atomic_inc(&obj->refcount);
+ apr_atomic_inc32(&obj->refcount);
#else
obj->refcount++;
#endif
@@ -221,7 +221,7 @@
obj->cleanup = 1;
#ifdef USE_ATOMICS
- if (!apr_atomic_dec(&obj->refcount)) {
+ if (!apr_atomic_dec32(&obj->refcount)) {
cleanup_cache_object(obj);
}
#else
@@ -357,7 +357,7 @@
/* Cleanup the cache object */
#ifdef USE_ATOMICS
- if (!apr_atomic_dec(&obj->refcount)) {
+ if (!apr_atomic_dec32(&obj->refcount)) {
if (obj->cleanup) {
cleanup_cache_object(obj);
}
@@ -399,9 +399,9 @@
/* Iterate over the cache and clean up each entry */
/* Free the object if the recount == 0 */
#ifdef USE_ATOMICS
- apr_atomic_inc(&obj->refcount);
+ apr_atomic_inc32(&obj->refcount);
obj->cleanup = 1;
- if (!apr_atomic_dec(&obj->refcount)) {
+ if (!apr_atomic_dec32(&obj->refcount)) {
#else
obj->cleanup = 1;
if (!obj->refcount) {
@@ -517,7 +517,7 @@
/* Finish initing the cache object */
#ifdef USE_ATOMICS
- apr_atomic_set(&obj->refcount, 1);
+ apr_atomic_set32(&obj->refcount, 1);
#else
obj->refcount = 1;
#endif
@@ -595,7 +595,7 @@
if (obj->complete) {
request_rec *rmain=r, *rtmp;
#ifdef USE_ATOMICS
- apr_atomic_inc(&obj->refcount);
+ apr_atomic_inc32(&obj->refcount);
#else
obj->refcount++;
#endif
@@ -758,7 +758,7 @@
/* Refcount increment in this case MUST be made under
* protection of the lock
*/
- apr_atomic_inc(&obj->refcount);
+ apr_atomic_inc32(&obj->refcount);
#else
if (!obj->refcount) {
cleanup_cache_object(obj);
@@ -774,7 +774,7 @@
}
#ifdef USE_ATOMICS
if (obj) {
- if (!apr_atomic_dec(&obj->refcount)) {
+ if (!apr_atomic_dec32(&obj->refcount)) {
cleanup_cache_object(obj);
}
}
1.32 +9 -9 httpd-2.0/server/mpm/experimental/leader/leader.c
Index: leader.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/experimental/leader/leader.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- leader.c 5 Sep 2003 16:50:21 -0000 1.31
+++ leader.c 16 Nov 2003 01:51:27 -0000 1.32
@@ -273,7 +273,7 @@
*/
typedef struct {
/* 'state' consists of several fields concatenated into a
- * single 32-bit int for use with the apr_atomic_cas() API:
+ * single 32-bit int for use with the apr_atomic_cas32() API:
* state & STACK_FIRST is the thread ID of the first thread
* in a linked list of idle threads
* state & STACK_TERMINATED indicates whether the proc is shutting down
@@ -308,7 +308,7 @@
if (state & STACK_TERMINATED) {
return APR_EINVAL;
}
- if (apr_atomic_cas(&(stack->state), STACK_LIST_END, state) !=
+ if (apr_atomic_cas32(&(stack->state), STACK_LIST_END, state) !=
state) {
continue;
}
@@ -317,7 +317,7 @@
}
}
wakeup->next = state;
- if (apr_atomic_cas(&(stack->state), worker_id, state) != state) {
+ if (apr_atomic_cas32(&(stack->state), worker_id, state) != state) {
continue;
}
else {
@@ -333,8 +333,8 @@
apr_uint32_t state = stack->state;
apr_uint32_t first = state & STACK_FIRST;
if (first == STACK_LIST_END) {
- if (apr_atomic_cas(&(stack->state), state | STACK_NO_LISTENER,
- state) != state) {
+ if (apr_atomic_cas32(&(stack->state), state | STACK_NO_LISTENER,
+ state) != state) {
continue;
}
else {
@@ -343,8 +343,8 @@
}
else {
worker_wakeup_info *wakeup = worker_wakeups[first];
- if (apr_atomic_cas(&(stack->state), (state ^ first) | wakeup->next,
- state) != state) {
+ if (apr_atomic_cas32(&(stack->state), (state ^ first) | wakeup->next,
+ state) != state) {
continue;
}
else {
@@ -373,8 +373,8 @@
while (1) {
apr_uint32_t state = stack->state;
- if (apr_atomic_cas(&(stack->state), state | STACK_TERMINATED,
- state) == state) {
+ if (apr_atomic_cas32(&(stack->state), state | STACK_TERMINATED,
+ state) == state) {
break;
}
}
1.16 +6 -6 httpd-2.0/server/mpm/winnt/child.c
Index: child.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/child.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- child.c 5 Jun 2003 16:54:48 -0000 1.15
+++ child.c 16 Nov 2003 01:51:28 -0000 1.16
@@ -206,7 +206,7 @@
context->accept_socket = INVALID_SOCKET;
context->ba = apr_bucket_alloc_create(pchild);
- apr_atomic_inc(&num_completion_contexts);
+ apr_atomic_inc32(&num_completion_contexts);
break;
}
} else {
@@ -671,10 +671,10 @@
mpm_recycle_completion_context(context);
- apr_atomic_inc(&g_blocked_threads);
+ apr_atomic_inc32(&g_blocked_threads);
while (1) {
if (workers_may_exit) {
- apr_atomic_dec(&g_blocked_threads);
+ apr_atomic_dec32(&g_blocked_threads);
return NULL;
}
rc = GetQueuedCompletionStatus(ThreadDispatchIOCP, &BytesRead, &CompKey,
@@ -691,15 +691,15 @@
context = CONTAINING_RECORD(pol, COMP_CONTEXT, Overlapped);
break;
case IOCP_SHUTDOWN:
- apr_atomic_dec(&g_blocked_threads);
+ apr_atomic_dec32(&g_blocked_threads);
return NULL;
default:
- apr_atomic_dec(&g_blocked_threads);
+ apr_atomic_dec32(&g_blocked_threads);
return NULL;
}
break;
}
- apr_atomic_dec(&g_blocked_threads);
+ apr_atomic_dec32(&g_blocked_threads);
return context;
}