summaryrefslogtreecommitdiff
path: root/include/apr_portable.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/apr_portable.h')
-rw-r--r--include/apr_portable.h47
1 files changed, 44 insertions, 3 deletions
diff --git a/include/apr_portable.h b/include/apr_portable.h
index 45d53eb15422d..f56997e4d187a 100644
--- a/include/apr_portable.h
+++ b/include/apr_portable.h
@@ -46,6 +46,9 @@
#if APR_HAVE_PTHREAD_H
#include <pthread.h>
#endif
+#if APR_HAVE_SEMAPHORE_H
+#include <semaphore.h>
+#endif
#ifdef __cplusplus
extern "C" {
@@ -140,6 +143,10 @@ struct apr_os_proc_mutex_t {
pthread_mutex_t *intraproc;
#endif
#endif
+#if APR_HAS_POSIXSEM_SERIALIZE
+ /** Value used for POSIX semaphores serialization */
+ sem_t *psem_interproc;
+#endif
};
typedef int apr_os_file_t; /**< native file */
@@ -241,7 +248,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock,
apr_socket_t *sock);
/**
- * Convert the proc mutex from os specific type to apr type
+ * Convert the proc mutex from apr type to os specific type
* @param ospmutex The os specific proc mutex we are converting to.
* @param pmutex The apr proc mutex to convert.
*/
@@ -249,6 +256,19 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex,
apr_proc_mutex_t *pmutex);
/**
+ * Convert the proc mutex from apr type to os specific type, also
+ * providing the mechanism used by the apr mutex.
+ * @param ospmutex The os specific proc mutex we are converting to.
+ * @param pmutex The apr proc mutex to convert.
+ * @param mech The mechanism used by the apr proc mutex (if not NULL).
+ * @remark Allows for disambiguation for platforms with multiple mechanisms
+ * available.
+ */
+APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex,
+ apr_proc_mutex_t *pmutex,
+ apr_lockmech_e *mech);
+
+/**
* Get the exploded time in the platforms native format.
* @param ostime the native time format
* @param aprtime the time to convert
@@ -380,7 +400,10 @@ APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir,
apr_pool_t *cont);
/**
- * Convert a socket from the os specific type to the apr type
+ * Convert a socket from the os specific type to the APR type. If
+ * sock points to NULL, a socket will be created from the pool
+ * provided. If **sock does not point to NULL, the structure pointed
+ * to by sock will be reused and updated with the given socket.
* @param sock The pool to use.
* @param thesock The socket to convert to.
* @param cont The socket we are converting to an apr type.
@@ -416,6 +439,24 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex,
apr_pool_t *cont);
/**
+ * Convert the proc mutex from os specific type to apr type, using the
+ * specified mechanism.
+ * @param pmutex The apr proc mutex we are converting to.
+ * @param ospmutex The os specific proc mutex to convert.
+ * @param mech The apr mutex locking mechanism
+ * @param register_cleanup Whether to destroy the os mutex with the apr
+ * one (either on explicit destroy or pool cleanup).
+ * @param cont The pool to use if it is needed.
+ * @remark Allows for disambiguation for platforms with multiple mechanisms
+ * available.
+ */
+APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex,
+ apr_os_proc_mutex_t *ospmutex,
+ apr_lockmech_e mech,
+ int register_cleanup,
+ apr_pool_t *cont);
+
+/**
* Put the imploded time in the APR format.
* @param aprtime the APR time format
* @param ostime the time to convert
@@ -494,7 +535,7 @@ APR_DECLARE(const char*) apr_os_default_encoding(apr_pool_t *pool);
/**
* Get the name of the current locale character set.
* @param pool the pool to allocate the name from, if needed
- * @remark Defers to apr_os_default_encoding if the current locale's
+ * @remark Defers to apr_os_default_encoding() if the current locale's
* data can't be retrieved on this system.
*/
APR_DECLARE(const char*) apr_os_locale_encoding(apr_pool_t *pool);