#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header$");
+RCSID
+ ("$Header$");
#if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
#define AFS_GRMUTEX_DECLSPEC __declspec(dllexport)
static int glock_init;
static pthread_once_t glock_init_once = PTHREAD_ONCE_INIT;
-static void glock_init_func(void) {
- pthread_mutex_init(&grmutex.mut, (const pthread_mutexattr_t *) 0);
+static void
+glock_init_func(void)
+{
+ pthread_mutex_init(&grmutex.mut, (const pthread_mutexattr_t *)0);
grmutex.times_inside = 0;
grmutex.owner = (pthread_t) 0;
grmutex.locked = 0;
glock_init = 1;
}
-int pthread_recursive_mutex_lock(pthread_recursive_mutex_t *mut) {
- int rc=0;
+int
+pthread_recursive_mutex_lock(pthread_recursive_mutex_t * mut)
+{
+ int rc = 0;
(glock_init || pthread_once(&glock_init_once, glock_init_func));
if (mut->locked) {
- if (pthread_equal(mut->owner,pthread_self())) {
+ if (pthread_equal(mut->owner, pthread_self())) {
mut->times_inside++;
return rc;
}
- }
+ }
rc = pthread_mutex_lock(&mut->mut);
if (rc == 0) {
mut->times_inside = 1;
return rc;
}
-int pthread_recursive_mutex_unlock(pthread_recursive_mutex_t *mut) {
- int rc=0;
+int
+pthread_recursive_mutex_unlock(pthread_recursive_mutex_t * mut)
+{
+ int rc = 0;
(glock_init || pthread_once(&glock_init_once, glock_init_func));
- if ((mut->locked) && (pthread_equal(mut->owner,pthread_self()))) {
+ if ((mut->locked) && (pthread_equal(mut->owner, pthread_self()))) {
mut->times_inside--;
if (mut->times_inside == 0) {
mut->locked = 0;