You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by dr...@apache.org on 2001/06/05 11:15:11 UTC
cvs commit: apr/locks/beos crossproc.c intraproc.c locks.c
dreid 01/06/05 02:15:10
Modified: include/arch/beos locks.h
locks/beos crossproc.c intraproc.c locks.c
Log:
Fix a silly typo and add support for apr_lock_sms_create to BeOS.
Revision Changes Path
1.13 +1 -1 apr/include/arch/beos/locks.h
Index: locks.h
===================================================================
RCS file: /home/cvs/apr/include/arch/beos/locks.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- locks.h 2001/06/05 08:15:14 1.12
+++ locks.h 2001/06/05 09:15:02 1.13
@@ -89,7 +89,7 @@
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_lockscope_e scope, const char *fname,
apr_sms_t *mem_sys);
#endif /* LOCKS_H */
1.21 +4 -3 apr/locks/beos/crossproc.c
Index: crossproc.c
===================================================================
RCS file: /home/cvs/apr/locks/beos/crossproc.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- crossproc.c 2001/02/16 04:15:53 1.20
+++ crossproc.c 2001/06/05 09:15:05 1.21
@@ -52,9 +52,10 @@
* <http://www.apache.org/>.
*/
+#include "unix/apr_private.h"
#include "beos/locks.h"
-apr_status_t lock_inter_cleanup(void * data)
+static apr_status_t lock_inter_cleanup(void * data)
{
apr_lock_t *lock = (apr_lock_t*)data;
if (lock->ben_interproc != 0) {
@@ -81,7 +82,7 @@
}
new->ben_interproc = 0;
new->sem_interproc = stat;
- apr_pool_cleanup_register(new->cntxt, (void *)new, lock_inter_cleanup,
+ APR_REGISTER_CLEANUP(new, (void *)new, lock_inter_cleanup,
apr_pool_cleanup_null);
return APR_SUCCESS;
}
@@ -116,7 +117,7 @@
{
apr_status_t stat;
if ((stat = lock_inter_cleanup(lock)) == APR_SUCCESS) {
- apr_pool_cleanup_kill(lock->cntxt, lock, lock_inter_cleanup);
+ APR_REMOVE_CLEANUP(lock, lock, lock_inter_cleanup);
return APR_SUCCESS;
}
return stat;
1.17 +4 -3 apr/locks/beos/intraproc.c
Index: intraproc.c
===================================================================
RCS file: /home/cvs/apr/locks/beos/intraproc.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- intraproc.c 2001/02/16 04:15:53 1.16
+++ intraproc.c 2001/06/05 09:15:06 1.17
@@ -52,9 +52,10 @@
* <http://www.apache.org/>.
*/
+#include "unix/apr_private.h"
#include "beos/locks.h"
-apr_status_t lock_intra_cleanup(void *data)
+static apr_status_t lock_intra_cleanup(void *data)
{
apr_lock_t *lock = (apr_lock_t *)data;
if (lock->ben_intraproc != 0) {
@@ -76,7 +77,7 @@
}
new->ben_intraproc = 0;
new->sem_intraproc = stat;
- apr_pool_cleanup_register(new->cntxt, (void *)new, lock_intra_cleanup,
+ APR_REGISTER_CLEANUP(new, (void *)new, lock_intra_cleanup,
apr_pool_cleanup_null);
return APR_SUCCESS;
}
@@ -111,7 +112,7 @@
{
apr_status_t stat;
if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) {
- apr_pool_cleanup_kill(lock->cntxt, lock, lock_intra_cleanup);
+ APR_REMOVE_CLEANUP(lock, lock, lock_intra_cleanup);
return APR_SUCCESS;
}
return stat;
1.28 +35 -0 apr/locks/beos/locks.c
Index: locks.c
===================================================================
RCS file: /home/cvs/apr/locks/beos/locks.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- locks.c 2001/05/31 03:29:56 1.27
+++ locks.c 2001/06/05 09:15:07 1.28
@@ -90,6 +90,41 @@
return APR_SUCCESS;
}
+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)
+{
+ apr_lock_t *new;
+ apr_status_t stat;
+
+ /* FIXME: Remove when read write locks implemented. */
+ if (type == APR_READWRITE)
+ return APR_ENOTIMPL;
+
+ new = (apr_lock_t *)apr_sms_malloc(mem_sys, sizeof(apr_lock_t));
+ if (new == NULL){
+ return APR_ENOMEM;
+ }
+
+ new->mem_sys = mem_sys;
+ new->cntxt = NULL;
+ new->type = type;
+ new->scope = scope;
+
+ if (scope != APR_CROSS_PROCESS) {
+ if ((stat = create_intra_lock(new)) != APR_SUCCESS) {
+ return stat;
+ }
+ }
+ if (scope != APR_INTRAPROCESS) {
+ if ((stat = create_inter_lock(new)) != APR_SUCCESS) {
+ return stat;
+ }
+ }
+ (*lock) = new;
+ return APR_SUCCESS;
+}
+
apr_status_t apr_lock_acquire(apr_lock_t *lock)
{
apr_status_t stat;