diff options
author | Ivan Zhakov <ivan@apache.org> | 2022-11-20 07:14:38 +0000 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2022-11-20 07:14:38 +0000 |
commit | 4f9b76b6f2acc4030ce9ef164322514c5d0e761b (patch) | |
tree | 9b993b3753affcbf164056826f9d568d8760b3a1 /locks/beos | |
parent | 961caf5f46055483fa72ab02f5e8baa16c209e2f (diff) | |
download | apr-4f9b76b6f2acc4030ce9ef164322514c5d0e761b.tar.gz |
Remove trailing whitespaces in *.c.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks/beos')
-rw-r--r-- | locks/beos/proc_mutex.c | 20 | ||||
-rw-r--r-- | locks/beos/thread_cond.c | 34 | ||||
-rw-r--r-- | locks/beos/thread_mutex.c | 40 | ||||
-rw-r--r-- | locks/beos/thread_rwlock.c | 14 |
4 files changed, 54 insertions, 54 deletions
diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index 35a5e8f10..47789a1e2 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -17,7 +17,7 @@ /*Read/Write locking implementation based on the MultiLock code from * Stephen Beaulieu <hippo@be.com> */ - + #include "apr_arch_proc_mutex.h" #include "apr_strings.h" #include "apr_portable.h" @@ -28,7 +28,7 @@ static apr_status_t _proc_mutex_cleanup(void * data) if (lock->LockCount != 0) { /* we're still locked... */ while (atomic_add(&lock->LockCount , -1) > 1){ - /* OK we had more than one person waiting on the lock so + /* OK we had more than one person waiting on the lock so * the sem is also locked. Release it until we have no more * locks left. */ @@ -37,7 +37,7 @@ static apr_status_t _proc_mutex_cleanup(void * data) } delete_sem(lock->Lock); return APR_SUCCESS; -} +} APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, @@ -46,7 +46,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, { apr_proc_mutex_t *new; apr_status_t stat = APR_SUCCESS; - + if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { return APR_ENOTIMPL; } @@ -55,13 +55,13 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, if (new == NULL){ return APR_ENOMEM; } - + if ((stat = create_sem(0, "APR_Lock")) < B_NO_ERROR) { _proc_mutex_cleanup(new); return stat; } new->LockCount = 0; - new->Lock = stat; + new->Lock = stat; new->pool = pool; apr_pool_cleanup_register(new->pool, (void *)new, _proc_mutex_cleanup, @@ -77,11 +77,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, { return APR_SUCCESS; } - + APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) { int32 stat; - + if (atomic_add(&mutex->LockCount, 1) > 0) { if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) { atomic_add(&mutex->LockCount, -1); @@ -135,7 +135,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { int32 stat; - + if (atomic_add(&mutex->LockCount, -1) > 1) { if ((stat = release_sem(mutex->Lock)) < B_NO_ERROR) { atomic_add(&mutex->LockCount, 1); @@ -187,7 +187,7 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex, +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) { diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index a0978c008..33b77cf71 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -36,16 +36,16 @@ static struct waiter_t *make_waiter(apr_pool_t *pool) apr_palloc(pool, sizeof(struct waiter_t)); if (w == NULL) return NULL; - + w->sem = create_sem(0, "apr conditional waiter"); if (w->sem < 0) return NULL; APR_RING_ELEM_INIT(w, link); - + return w; } - + APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool) { @@ -60,12 +60,12 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, if ((rv = create_sem(1, "apr conditional lock")) < B_OK) return rv; - + new_cond->lock = rv; new_cond->pool = pool; APR_RING_INIT(&new_cond->alist, waiter_t, link); APR_RING_INIT(&new_cond->flist, waiter_t, link); - + for (i=0;i < 10 ;i++) { struct waiter_t *nw = make_waiter(pool); APR_RING_INSERT_TAIL(&new_cond->flist, nw, waiter_t, link); @@ -87,8 +87,8 @@ static apr_status_t do_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, thread_id cth = find_thread(NULL); apr_status_t rv; int flags = B_RELATIVE_TIMEOUT; - - /* We must be the owner of the mutex or we can't do this... */ + + /* We must be the owner of the mutex or we can't do this... */ if (mutex->owner != cth) { /* What should we return??? */ return APR_EINVAL; @@ -99,31 +99,31 @@ static apr_status_t do_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, if (wait) APR_RING_REMOVE(wait, link); else - wait = make_waiter(cond->pool); + wait = make_waiter(cond->pool); APR_RING_INSERT_TAIL(&cond->alist, wait, waiter_t, link); cond->condlock = mutex; release_sem(cond->lock); - + apr_thread_mutex_unlock(cond->condlock); if (timeout == 0) flags = 0; - + rv = acquire_sem_etc(wait->sem, 1, flags, timeout); apr_thread_mutex_lock(cond->condlock); - + if (rv != B_OK) { if (rv == B_TIMED_OUT) return APR_TIMEUP; - return rv; + return rv; } acquire_sem(cond->lock); APR_RING_REMOVE(wait, link); APR_RING_INSERT_TAIL(&cond->flist, wait, waiter_t, link); release_sem(cond->lock); - + return APR_SUCCESS; } @@ -144,7 +144,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { struct waiter_t *wake; - acquire_sem(cond->lock); + acquire_sem(cond->lock); if (!APR_RING_EMPTY(&cond->alist, waiter_t, link)) { wake = APR_RING_FIRST(&cond->alist); APR_RING_REMOVE(wake, link); @@ -152,14 +152,14 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) APR_RING_INSERT_TAIL(&cond->flist, wake, waiter_t, link); } release_sem(cond->lock); - + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) { struct waiter_t *wake; - + acquire_sem(cond->lock); while (! APR_RING_EMPTY(&cond->alist, waiter_t, link)) { wake = APR_RING_FIRST(&cond->alist); @@ -168,7 +168,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) APR_RING_INSERT_TAIL(&cond->flist, wake, waiter_t, link); } release_sem(cond->lock); - + return APR_SUCCESS; } diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index e4099d882..2cc1c6cc6 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -17,7 +17,7 @@ /*Read/Write locking implementation based on the MultiLock code from * Stephen Beaulieu <hippo@be.com> */ - + #include "apr_arch_thread_mutex.h" #include "apr_strings.h" #include "apr_portable.h" @@ -28,7 +28,7 @@ static apr_status_t _thread_mutex_cleanup(void * data) if (lock->LockCount != 0) { /* we're still locked... */ while (atomic_add(&lock->LockCount , -1) > 1){ - /* OK we had more than one person waiting on the lock so + /* OK we had more than one person waiting on the lock so * the sem is also locked. Release it until we have no more * locks left. */ @@ -37,7 +37,7 @@ static apr_status_t _thread_mutex_cleanup(void * data) } delete_sem(lock->Lock); return APR_SUCCESS; -} +} APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, unsigned int flags, @@ -45,21 +45,21 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, { apr_thread_mutex_t *new_m; apr_status_t stat = APR_SUCCESS; - + new_m = (apr_thread_mutex_t *)apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); if (new_m == NULL){ return APR_ENOMEM; } - + if ((stat = create_sem(0, "APR_Lock")) < B_NO_ERROR) { _thread_mutex_cleanup(new_m); return stat; } new_m->LockCount = 0; - new_m->Lock = stat; + new_m->Lock = stat; new_m->pool = pool; - /* Optimal default is APR_THREAD_MUTEX_UNNESTED, + /* Optimal default is APR_THREAD_MUTEX_UNNESTED, * no additional checks required for either flag. */ new_m->nested = flags & APR_THREAD_MUTEX_NESTED; @@ -78,19 +78,19 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create_np(apr_thread_mutex_t **mutex, apr_pool_t *pool) { return APR_ENOTIMPL; -} +} #endif - + APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { int32 stat; thread_id me = find_thread(NULL); - + if (mutex->nested && mutex->owner == me) { mutex->owner_ref++; return APR_SUCCESS; } - + if (atomic_add(&mutex->LockCount, 1) > 0) { if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) { /* Oh dear, acquire_sem failed!! */ @@ -101,7 +101,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) mutex->owner = me; mutex->owner_ref = 1; - + return APR_SUCCESS; } @@ -109,12 +109,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { int32 stat; thread_id me = find_thread(NULL); - + if (mutex->nested && mutex->owner == me) { mutex->owner_ref++; return APR_SUCCESS; } - + if (atomic_add(&mutex->LockCount, 1) > 0) { if ((stat = acquire_sem_etc(mutex->Lock, 1, 0, 0)) < B_NO_ERROR) { atomic_add(&mutex->LockCount, -1); @@ -127,7 +127,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) mutex->owner = me; mutex->owner_ref = 1; - + return APR_SUCCESS; } @@ -136,12 +136,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, { int32 stat; thread_id me = find_thread(NULL); - + if (mutex->nested && mutex->owner == me) { mutex->owner_ref++; return APR_SUCCESS; } - + if (atomic_add(&mutex->LockCount, 1) > 0) { if (timeout <= 0) { stat = B_TIMED_OUT; @@ -161,20 +161,20 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, mutex->owner = me; mutex->owner_ref = 1; - + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { int32 stat; - + if (mutex->nested && mutex->owner == find_thread(NULL)) { mutex->owner_ref--; if (mutex->owner_ref > 0) return APR_SUCCESS; } - + if (atomic_add(&mutex->LockCount, -1) > 1) { if ((stat = release_sem(mutex->Lock)) < B_NO_ERROR) { atomic_add(&mutex->LockCount, 1); diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c index a540b4455..363455a7a 100644 --- a/locks/beos/thread_rwlock.c +++ b/locks/beos/thread_rwlock.c @@ -17,7 +17,7 @@ /*Read/Write locking implementation based on the MultiLock code from * Stephen Beaulieu <hippo@be.com> */ - + #include "apr_arch_thread_rwlock.h" #include "apr_strings.h" #include "apr_portable.h" @@ -43,23 +43,23 @@ static apr_status_t _thread_rw_cleanup(void * data) release_sem (mutex->Lock); } } - + delete_sem(mutex->Read); delete_sem(mutex->Write); delete_sem(mutex->Lock); return APR_SUCCESS; -} +} APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, apr_pool_t *pool) { apr_thread_rwlock_t *new; - + new = (apr_thread_rwlock_t *)apr_pcalloc(pool, sizeof(apr_thread_rwlock_t)); if (new == NULL){ return APR_ENOMEM; } - + new->pool = pool; /* we need to make 3 locks... */ new->ReadCount = 0; @@ -68,7 +68,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, new->Read = create_sem(0, "APR_ReadLock"); new->Write = create_sem(0, "APR_WriteLock"); new->Lock = create_sem(0, "APR_Lock"); - + if (new->Lock < 0 || new->Read < 0 || new->Write < 0) { _thread_rw_cleanup(new); return -1; @@ -132,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) rwlock->writer = find_thread(NULL); } } - + return rv; } |