* prof_file.c (profile_dereference_data_locked): New function.
authorKen Raeburn <raeburn@mit.edu>
Tue, 28 Sep 2004 16:38:12 +0000 (16:38 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 28 Sep 2004 16:38:12 +0000 (16:38 +0000)
(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

src/util/profile/ChangeLog
src/util/profile/prof_file.c
src/util/profile/prof_int.h
src/util/profile/prof_set.c

index 933119804df8b67cbb2883583e37fe9724c6f0e5..146b852fa41ad0e725f7389a3b555487a248d82f 100644 (file)
@@ -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.
index 2baebfbc179e7ae2f685036298acfc1783bcf042..f4bdc4bccebd00b52fbc28051f742e32e7b61e8c 100644 (file)
@@ -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
index 4a1d7b65ade5fe2f0e3f24a370c4eede9046903f..e07b0c1e3bcc3b9e197cc7cf3c6f3a992b9b362e 100644 (file)
@@ -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
index 310949b0ec7f327483820ff568ea46808eb7cf47..eb395a17e91453a3af2e06d00e82701e35ec176f 100644 (file)
@@ -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 */