Apache HTTPD
thread_mutex.c
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "apr_general.h"
18#include "apr_lib.h"
19#include "apr_strings.h"
20#include "apr_portable.h"
21#include "apr_arch_thread_mutex.h"
22#include "apr_arch_file_io.h"
23#include <string.h>
24#include <stddef.h>
25
31
32
33
34/* XXX: Need to respect APR_THREAD_MUTEX_[UN]NESTED flags argument
35 * or return APR_ENOTIMPL!!!
36 */
55
56
57
59{
61 return APR_OS2_STATUS(rc);
62}
63
64
65
67{
69
71}
72
73
74
77{
78 ULONG rc;
79
80 if (timeout <= 0) {
82 }
83 else {
85 }
86
88}
89
90
91
93{
95 return APR_OS2_STATUS(rc);
96}
97
98
99
101{
102 ULONG rc;
103
104 if (mutex->hMutex == 0)
105 return APR_SUCCESS;
106
107 while (DosReleaseMutexSem(mutex->hMutex) == 0);
108
109 rc = DosCloseMutexSem(mutex->hMutex);
110
111 if (!rc) {
112 mutex->hMutex = 0;
113 return APR_SUCCESS;
114 }
115
116 return APR_FROM_OS_ERROR(rc);
117}
118
120
#define FALSE
Definition abts.h:35
APR Miscellaneous library routines.
APR general purpose library routines.
APR Portability Routines.
APR Strings library.
#define APR_TIMEUP
Definition apr_errno.h:450
#define APR_EBUSY
Definition apr_errno.h:480
const char apr_ssize_t int flags
Definition apr_encode.h:168
apr_redis_t * rc
Definition apr_redis.h:173
const void apr_status_t(*) apr_status_t(* APR_DECLARE)(void) apr_pool_pre_cleanup_register(apr_pool_t *p
Definition apr_pools.h:646
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
#define APR_FROM_OS_ERROR(e)
Definition apr_errno.h:1214
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
#define APR_POOL_IMPLEMENT_ACCESSOR(type)
Definition apr_pools.h:91
#define apr_time_as_msec(time)
Definition apr_time.h:72
apr_int64_t apr_interval_time_t
Definition apr_time.h:55
return NULL
Definition mod_so.c:359
static apr_status_t thread_mutex_cleanup(void *data)
IN ULONG IN INT timeout