aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2004-09-28 16:38:12 +0000
committerKen Raeburn <raeburn@mit.edu>2004-09-28 16:38:12 +0000
commit84b6ea41dce83e29c355998f3ab1d6901d911d0b (patch)
tree6a49f8396c750d6b4a7dbf07148c44595c9037f6
parentbc5a32edcf13792df0f26985b41b65bcf5777d02 (diff)
downloadkrb5-84b6ea41dce83e29c355998f3ab1d6901d911d0b.zip
krb5-84b6ea41dce83e29c355998f3ab1d6901d911d0b.tar.gz
krb5-84b6ea41dce83e29c355998f3ab1d6901d911d0b.tar.bz2
* prof_file.c (profile_dereference_data_locked): New function.
(profile_dereference_data): Call it. * prof_set.c (rw_setup): Likewise. * prof_int.h (profile_dereference_data_locked): Declare it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16792 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/util/profile/ChangeLog7
-rw-r--r--src/util/profile/prof_file.c10
-rw-r--r--src/util/profile/prof_int.h1
-rw-r--r--src/util/profile/prof_set.c2
4 files changed, 18 insertions, 2 deletions
diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog
index 9331198..146b852 100644
--- a/src/util/profile/ChangeLog
+++ b/src/util/profile/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-28 Ken Raeburn <raeburn@mit.edu>
+
+ * prof_file.c (profile_dereference_data_locked): New function.
+ (profile_dereference_data): Call it.
+ * prof_set.c (rw_setup): Likewise.
+ * prof_int.h (profile_dereference_data_locked): Declare it.
+
2004-09-26 Tom Yu <tlyu@mit.edu>
* Makefile.in (check-unix-tcl-ok): Use KRB5_RUN_ENV.
diff --git a/src/util/profile/prof_file.c b/src/util/profile/prof_file.c
index 2baebfb..f4bdc4b 100644
--- a/src/util/profile/prof_file.c
+++ b/src/util/profile/prof_file.c
@@ -425,10 +425,18 @@ void profile_dereference_data(prf_data_t data)
err = k5_mutex_lock(&g_shared_trees_mutex);
if (err)
return;
+ profile_dereference_data_locked(data);
+ (void) k5_mutex_unlock(&g_shared_trees_mutex);
+#else
+ profile_free_file_data(data);
+#endif
+}
+void profile_dereference_data_locked(prf_data_t data)
+{
+#ifdef SHARE_TREE_DATA
data->refcount--;
if (data->refcount == 0)
profile_free_file_data(data);
- (void) k5_mutex_unlock(&g_shared_trees_mutex);
#else
profile_free_file_data(data);
#endif
diff --git a/src/util/profile/prof_int.h b/src/util/profile/prof_int.h
index 4a1d7b6..e07b0c1 100644
--- a/src/util/profile/prof_int.h
+++ b/src/util/profile/prof_int.h
@@ -199,6 +199,7 @@ errcode_t profile_close_file
(prf_file_t profile);
void profile_dereference_data (prf_data_t);
+void profile_dereference_data_locked (prf_data_t);
/* prof_init.c -- included from profile.h */
errcode_t profile_ser_size
diff --git a/src/util/profile/prof_set.c b/src/util/profile/prof_set.c
index 310949b..eb395a1 100644
--- a/src/util/profile/prof_set.c
+++ b/src/util/profile/prof_set.c
@@ -74,7 +74,7 @@ static errcode_t rw_setup(profile_t profile)
free(new_data);
return retval;
}
- profile_dereference_data(file->data);
+ profile_dereference_data_locked(file->data);
file->data = new_data;
}
#endif /* SHARE_TREE_DATA */