Lines Matching +full:lock +full:- +full:state

1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3 * prof_set.c --- routines that expose the public interfaces for
32 if (profile->magic != PROF_MAGIC_PROFILE) in rw_setup()
35 /* If the profile has no files, create a memory-only data object. */ in rw_setup()
36 if (profile->first_file == NULL) { in rw_setup()
37 profile->first_file = profile_open_memory(); in rw_setup()
38 return (profile->first_file == NULL) ? ENOMEM : 0; in rw_setup()
41 file = profile->first_file; in rw_setup()
46 if (file->data->flags & PROFILE_FILE_DIRTY) { in rw_setup()
51 if ((file->data->flags & PROFILE_FILE_SHARED) != 0) { in rw_setup()
52 new_data = profile_make_prf_data(file->data->filespec); in rw_setup()
57 new_data->root = NULL; in rw_setup()
58 new_data->flags = file->data->flags & ~PROFILE_FILE_SHARED; in rw_setup()
59 new_data->timestamp = 0; in rw_setup()
60 new_data->upd_serial = file->data->upd_serial; in rw_setup()
62 profile_dereference_data_locked(file->data); in rw_setup()
63 file->data = new_data; in rw_setup()
74 * ADL - 2/23/99, rewritten TYT 2/25/99
82 void *state; in profile_update_relation() local
85 if (profile->vt) { in profile_update_relation()
86 if (!profile->vt->update_relation) in profile_update_relation()
88 return profile->vt->update_relation(profile->cbdata, names, old_value, in profile_update_relation()
102 k5_mutex_lock(&profile->first_file->data->lock); in profile_update_relation()
103 section = profile->first_file->data->root; in profile_update_relation()
105 state = 0; in profile_update_relation()
107 &state, &section); in profile_update_relation()
109 k5_mutex_unlock(&profile->first_file->data->lock); in profile_update_relation()
114 state = 0; in profile_update_relation()
115 retval = profile_find_node(section, *cpp, old_value, 0, &state, &node); in profile_update_relation()
123 profile->first_file->data->flags |= PROFILE_FILE_DIRTY; in profile_update_relation()
124 k5_mutex_unlock(&profile->first_file->data->lock); in profile_update_relation()
132 * TYT - 2/25/99
139 void *state; in profile_clear_relation() local
142 if (profile->vt) { in profile_clear_relation()
143 if (!profile->vt->update_relation) in profile_clear_relation()
145 return profile->vt->update_relation(profile->cbdata, names, NULL, in profile_clear_relation()
156 section = profile->first_file->data->root; in profile_clear_relation()
158 state = 0; in profile_clear_relation()
160 &state, &section); in profile_clear_relation()
165 state = 0; in profile_clear_relation()
167 retval = profile_find_node(section, *cpp, 0, 0, &state, &node); in profile_clear_relation()
173 } while (state); in profile_clear_relation()
175 profile->first_file->data->flags |= PROFILE_FILE_DIRTY; in profile_clear_relation()
184 * ADL - 2/23/99, rewritten TYT 2/25/99
192 void *state; in profile_rename_section() local
195 if (profile->vt) { in profile_rename_section()
196 if (!profile->vt->rename_section) in profile_rename_section()
198 return profile->vt->rename_section(profile->cbdata, names, new_name); in profile_rename_section()
208 k5_mutex_lock(&profile->first_file->data->lock); in profile_rename_section()
209 section = profile->first_file->data->root; in profile_rename_section()
211 state = 0; in profile_rename_section()
213 &state, &section); in profile_rename_section()
215 k5_mutex_unlock(&profile->first_file->data->lock); in profile_rename_section()
220 state = 0; in profile_rename_section()
221 retval = profile_find_node(section, *cpp, 0, 1, &state, &node); in profile_rename_section()
229 profile->first_file->data->flags |= PROFILE_FILE_DIRTY; in profile_rename_section()
230 k5_mutex_unlock(&profile->first_file->data->lock); in profile_rename_section()
241 * ADL - 2/23/99, rewritten TYT 2/25/99
250 void *state; in profile_add_relation() local
252 if (profile->vt) { in profile_add_relation()
253 if (!profile->vt->add_relation) in profile_add_relation()
255 return profile->vt->add_relation(profile->cbdata, names, new_value); in profile_add_relation()
266 k5_mutex_lock(&profile->first_file->data->lock); in profile_add_relation()
267 section = profile->first_file->data->root; in profile_add_relation()
269 state = 0; in profile_add_relation()
271 &state, &section); in profile_add_relation()
275 k5_mutex_unlock(&profile->first_file->data->lock); in profile_add_relation()
281 state = 0; in profile_add_relation()
282 retval = profile_find_node(section, *cpp, 0, 1, &state, 0); in profile_add_relation()
284 k5_mutex_unlock(&profile->first_file->data->lock); in profile_add_relation()
287 k5_mutex_unlock(&profile->first_file->data->lock); in profile_add_relation()
294 k5_mutex_unlock(&profile->first_file->data->lock); in profile_add_relation()
298 profile->first_file->data->flags |= PROFILE_FILE_DIRTY; in profile_add_relation()
299 k5_mutex_unlock(&profile->first_file->data->lock); in profile_add_relation()