#include "mpm_winnt.h"
#include "mpm_common.h"
#include <malloc.h>
+#include "apr_atomic.h"
/* Limit on the threads per process. Clients will be locked out if more than
* this * HARD_SERVER_LIMIT are needed.
context->accept_socket = INVALID_SOCKET;
context->ba = apr_bucket_alloc_create(pchild);
- num_completion_contexts++;
+ apr_atomic_inc(&num_completion_contexts);
}
return context;
mpm_recycle_completion_context(context);
- g_blocked_threads++;
+ apr_atomic_inc(&g_blocked_threads);
while (1) {
if (workers_may_exit) {
- g_blocked_threads--;
+ apr_atomic_dec(&g_blocked_threads);
return NULL;
}
rc = GetQueuedCompletionStatus(ThreadDispatchIOCP, &BytesRead, &CompKey,
context = CONTAINING_RECORD(pol, COMP_CONTEXT, Overlapped);
break;
case IOCP_SHUTDOWN:
- g_blocked_threads--;
+ apr_atomic_dec(&g_blocked_threads);
return NULL;
default:
- g_blocked_threads--;
+ apr_atomic_dec(&g_blocked_threads);
return NULL;
}
break;
}
-
- g_blocked_threads--;
+ apr_atomic_dec(&g_blocked_threads);
return context;
}