summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordreid <dreid@13f79535-47bb-0310-9956-ffa450edef68>2001-06-05 08:15:37 +0000
committerdreid <dreid@13f79535-47bb-0310-9956-ffa450edef68>2001-06-05 08:15:37 +0000
commit51a551acabdd690d61b32a140eb35c1fa21df005 (patch)
treebd5d646a7be4fa86989e31aba06d7880d7278acc /include
parent617d7f11c673551685b5fef657acca30797835f9 (diff)
downloadlibapr-51a551acabdd690d61b32a140eb35c1fa21df005.tar.gz
OK, this basically adds a function that allows us to create
apr_lock_t's using an apr_sms_t for the memory. It's a very small first step, and at present is only intended to be used internally in APR, hence the position of the function definitions in the locks.h file. Given that we don't want to duplicate code where we don't have to, I've added some macros that allow us to do memory allocations regardless of whether we have a pool or sms. This also highlighted that we haven't yet managed to change our member names from cntxt to pool everywhere! The surprise comes in just how far reaching the apr_pool_t goes. As apr_lock.h uses ap_sms_t and apr_sms.h uses apr_lock_t I've moved the tyepdef's into apr.h.in, but this may be bogus... Hopefully this will allow us to get locking into sms and so start moving forward again, and at the same time it starts to throw up the problems for changing our memory system throughout APR. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61698 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r--include/apr.h.in2
-rw-r--r--include/apr_lock.h3
-rw-r--r--include/apr_sms.h3
-rw-r--r--include/arch/beos/locks.h5
-rw-r--r--include/arch/os2/locks.h6
-rw-r--r--include/arch/unix/locks.h6
-rw-r--r--include/arch/win32/locks.h6
7 files changed, 27 insertions, 4 deletions
diff --git a/include/apr.h.in b/include/apr.h.in
index 63136726c..c72981e43 100644
--- a/include/apr.h.in
+++ b/include/apr.h.in
@@ -174,6 +174,8 @@ typedef @ssize_t_value@ apr_ssize_t;
typedef @off_t_value@ apr_off_t;
typedef @socklen_t_value@ apr_socklen_t;
+typedef struct apr_lock_t apr_lock_t;
+typedef struct apr_sms_t apr_sms_t;
/* Mechanisms to properly type numeric literals */
@int64_literal@
diff --git a/include/apr_lock.h b/include/apr_lock.h
index 1be21ed1a..9c5e08fdf 100644
--- a/include/apr_lock.h
+++ b/include/apr_lock.h
@@ -58,6 +58,7 @@
#include "apr.h"
#include "apr_pools.h"
#include "apr_errno.h"
+#include "apr_sms.h"
#ifdef __cplusplus
extern "C" {
@@ -73,8 +74,6 @@ typedef enum {APR_MUTEX, APR_READWRITE} apr_locktype_e;
typedef enum {APR_READER, APR_WRITER} apr_readerwriter_e;
-typedef struct apr_lock_t apr_lock_t;
-
/* Function definitions */
/**
diff --git a/include/apr_sms.h b/include/apr_sms.h
index ec7825ef8..38ff3b88b 100644
--- a/include/apr_sms.h
+++ b/include/apr_sms.h
@@ -79,8 +79,6 @@ extern "C" {
* @package APR memory system
*/
-typedef struct apr_sms_t apr_sms_t;
-
struct apr_sms_cleanup;
/**
@@ -94,6 +92,7 @@ struct apr_sms_t
apr_sms_t **ref_mem_sys;
apr_sms_t *accounting_mem_sys;
const char *identity; /* a string identifying the module */
+ apr_lock_t *lock;
struct apr_sms_cleanup *cleanups;
diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h
index ec3e77538..ce9fa6cfa 100644
--- a/include/arch/beos/locks.h
+++ b/include/arch/beos/locks.h
@@ -60,9 +60,11 @@
#include "apr_file_io.h"
#include "apr_general.h"
#include "apr_lib.h"
+#include "apr_sms.h"
struct apr_lock_t {
apr_pool_t *cntxt;
+ apr_sms_t *mem_sys;
apr_locktype_e type;
apr_lockscope_e scope;
/* Inter proc */
@@ -86,6 +88,9 @@ apr_status_t destroy_inter_lock(struct apr_lock_t *lock);
apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont,
const char *fname);
+apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
+ apr_lockscope_e scope, const_char *fname,
+ apr_sms_t *mem_sys);
#endif /* LOCKS_H */
diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h
index 7c0a87825..d3edf99d8 100644
--- a/include/arch/os2/locks.h
+++ b/include/arch/os2/locks.h
@@ -57,9 +57,11 @@
#include "apr_lock.h"
#include "apr_file_io.h"
+#include "apr_sms.h"
struct apr_lock_t {
apr_pool_t *cntxt;
+ apr_sms_t *mem_sys;
apr_locktype_e type;
apr_lockscope_e scope;
char *fname;
@@ -69,5 +71,9 @@ struct apr_lock_t {
TIB *tib;
};
+apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
+ apr_lockscope_e scope, const char *fname,
+ apr_sms_t *mem_sys);
+
#endif /* LOCKS_H */
diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h
index beaecac25..e34dcc769 100644
--- a/include/arch/unix/locks.h
+++ b/include/arch/unix/locks.h
@@ -60,6 +60,7 @@
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_lock.h"
+#include "apr_sms.h"
/* System headers required by Locks library */
#if APR_HAVE_SYS_TYPES_H
@@ -109,6 +110,7 @@ union semun {
struct apr_lock_t {
apr_pool_t *cntxt;
+ apr_sms_t *mem_sys;
apr_locktype_e type;
apr_lockscope_e scope;
int curr_locked;
@@ -155,5 +157,9 @@ apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock);
apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock,
apr_pool_t *cont, const char *fname);
+apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
+ apr_lockscope_e scope, const char *fname,
+ apr_sms_t *mem_sys);
+
#endif /* LOCKS_H */
diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h
index 38f8f105a..1083e685e 100644
--- a/include/arch/win32/locks.h
+++ b/include/arch/win32/locks.h
@@ -56,9 +56,11 @@
#define LOCKS_H
#include "apr_lock.h"
+#include "apr_sms.h"
struct apr_lock_t {
apr_pool_t *cntxt;
+ apr_sms_t *mem_sys;
apr_locktype_e type;
apr_lockscope_e scope;
HANDLE mutex;
@@ -66,5 +68,9 @@ struct apr_lock_t {
char *fname;
};
+apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
+ apr_lockscope_e scope, const char *fname,
+ apr_sms_t *mem_sys);
+
#endif /* LOCKS_H */