"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "locks/netware/proc_mutex.c" between
apr-1.6.5.tar.bz2 and apr-1.7.0.tar.bz2

About: APR (Apache Portable Runtime) project offers software libraries that provide a predictable and consistent interface to underlying platform-specific implementations (APR core library).

proc_mutex.c  (apr-1.6.5.tar.bz2):proc_mutex.c  (apr-1.7.0.tar.bz2)
skipping to change at line 29 skipping to change at line 29
#include "apr_portable.h" #include "apr_portable.h"
#include "apr_arch_proc_mutex.h" #include "apr_arch_proc_mutex.h"
#include "apr_arch_thread_mutex.h" #include "apr_arch_thread_mutex.h"
APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
const char *fname, const char *fname,
apr_lockmech_e mech, apr_lockmech_e mech,
apr_pool_t *pool) apr_pool_t *pool)
{ {
apr_status_t ret; apr_status_t ret;
apr_proc_mutex_t *new_mutex = NULL; apr_proc_mutex_t *new_mutex;
unsigned int flags = APR_THREAD_MUTEX_DEFAULT;
if (mech != APR_LOCK_DEFAULT) { *mutex = NULL;
if (mech == APR_LOCK_DEFAULT_TIMED) {
flags |= APR_THREAD_MUTEX_TIMED;
}
else if (mech != APR_LOCK_DEFAULT) {
return APR_ENOTIMPL; return APR_ENOTIMPL;
} }
new_mutex = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); new_mutex = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t));
if (new_mutex == NULL) { if (new_mutex == NULL) {
return APR_ENOMEM; return APR_ENOMEM;
} }
new_mutex->pool = pool; new_mutex->pool = pool;
ret = apr_thread_mutex_create(&(new_mutex->mutex), APR_THREAD_MUTEX_DEFAULT, pool); ret = apr_thread_mutex_create(&(new_mutex->mutex), flags, pool);
if (ret == APR_SUCCESS) if (ret == APR_SUCCESS)
*mutex = new_mutex; *mutex = new_mutex;
return ret; return ret;
} }
APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
const char *fname, const char *fname,
apr_pool_t *pool) apr_pool_t *pool)
skipping to change at line 70 skipping to change at line 75
return APR_ENOLOCK; return APR_ENOLOCK;
} }
APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex)
{ {
if (mutex) if (mutex)
return apr_thread_mutex_trylock(mutex->mutex); return apr_thread_mutex_trylock(mutex->mutex);
return APR_ENOLOCK; return APR_ENOLOCK;
} }
APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex,
apr_interval_time_t timeout)
{
if (mutex)
return apr_thread_mutex_timedlock(mutex->mutex, timeout);
return APR_ENOLOCK;
}
APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex)
{ {
if (mutex) if (mutex)
return apr_thread_mutex_unlock(mutex->mutex); return apr_thread_mutex_unlock(mutex->mutex);
return APR_ENOLOCK; return APR_ENOLOCK;
} }
APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex)
{ {
return apr_proc_mutex_destroy(mutex); return apr_proc_mutex_destroy(mutex);
skipping to change at line 149 skipping to change at line 162
APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex,
apr_os_proc_mutex_t *ospmutex, apr_os_proc_mutex_t *ospmutex,
apr_lockmech_e mech, apr_lockmech_e mech,
int register_cleanup, int register_cleanup,
apr_pool_t *pool) apr_pool_t *pool)
{ {
if (pool == NULL) { if (pool == NULL) {
return APR_ENOPOOL; return APR_ENOPOOL;
} }
if (mech != APR_LOCK_DEFAULT) { if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) {
return APR_ENOTIMPL; return APR_ENOTIMPL;
} }
#if 0 #if 0
/* We need to change apr_os_proc_mutex_t to a pointer type /* We need to change apr_os_proc_mutex_t to a pointer type
* to be able to implement this function. * to be able to implement this function.
*/ */
if ((*pmutex) == NULL) { if ((*pmutex) == NULL) {
(*pmutex) = apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); (*pmutex) = apr_pcalloc(pool, sizeof(apr_proc_mutex_t));
(*pmutex)->pool = pool; (*pmutex)->pool = pool;
} }
 End of changes. 5 change blocks. 
4 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)