Lines Matching refs:object

168 	nwamd_object_t object;  in nwamd_object_lists_fini()  local
174 while ((object = uu_list_teardown(object_lists[i].object_list, in nwamd_object_lists_fini()
176 free(object); in nwamd_object_lists_fini()
228 nwamd_object_t object; in nwamd_object_init() local
231 object = calloc(1, sizeof (struct nwamd_object)); in nwamd_object_init()
232 if (object == NULL) in nwamd_object_init()
235 (void) strlcpy(object->nwamd_object_name, name, NWAM_MAX_NAME_LEN); in nwamd_object_init()
238 object->nwamd_object_refcount = 2; in nwamd_object_init()
239 object->nwamd_object_handle = handle; in nwamd_object_init()
240 object->nwamd_object_data = data; in nwamd_object_init()
241 object->nwamd_object_type = type; in nwamd_object_init()
242 object->nwamd_object_state = NWAM_STATE_INITIALIZED; in nwamd_object_init()
243 object->nwamd_object_aux_state = NWAM_AUX_STATE_INITIALIZED; in nwamd_object_init()
249 free(object); in nwamd_object_init()
253 if (pthread_mutex_init(&object->nwamd_object_mutex, NULL) == -1) { in nwamd_object_init()
256 free(object); in nwamd_object_init()
260 (void) pthread_mutex_lock(&object->nwamd_object_mutex); in nwamd_object_init()
262 uu_list_node_init(object, &object->nwamd_object_node, object_list_pool); in nwamd_object_init()
264 uu_list_last(object_list->object_list), object); in nwamd_object_init()
268 return (object); in nwamd_object_init()
279 nwamd_object_t object; in nwamd_object_find() local
287 for (object = uu_list_first(object_list->object_list); in nwamd_object_find()
288 object != NULL; in nwamd_object_find()
289 object = uu_list_next(object_list->object_list, object)) { in nwamd_object_find()
290 if (strcmp(object->nwamd_object_name, name) == 0) in nwamd_object_find()
293 if (object != NULL) { in nwamd_object_find()
294 (void) pthread_mutex_lock(&object->nwamd_object_mutex); in nwamd_object_find()
295 object->nwamd_object_refcount++; in nwamd_object_find()
299 return (object); in nwamd_object_find()
304 nwamd_object_fini(nwamd_object_t object, nwam_object_type_t objtype) in nwamd_object_fini() argument
309 assert(object != NULL); in nwamd_object_fini()
316 if (o == object) { in nwamd_object_fini()
317 uu_list_remove(object_list->object_list, object); in nwamd_object_fini()
319 &object->nwamd_object_mutex); in nwamd_object_fini()
321 &object->nwamd_object_mutex); in nwamd_object_fini()
322 uu_list_node_fini(object, &object->nwamd_object_node, in nwamd_object_fini()
326 nwamd_ncu_free(object->nwamd_object_data); in nwamd_object_fini()
327 nwam_ncu_free(object->nwamd_object_handle); in nwamd_object_fini()
330 nwam_loc_free(object->nwamd_object_handle); in nwamd_object_fini()
333 nwam_enm_free(object->nwamd_object_handle); in nwamd_object_fini()
340 free(object); in nwamd_object_fini()
347 nwamd_object_decref(nwamd_object_t object, int num) in nwamd_object_decref() argument
351 assert(object->nwamd_object_refcount >= num); in nwamd_object_decref()
352 object->nwamd_object_refcount -= num; in nwamd_object_decref()
353 if (object->nwamd_object_refcount == 0) { in nwamd_object_decref()
366 object->nwamd_object_refcount++; in nwamd_object_decref()
367 objtype = object->nwamd_object_type; in nwamd_object_decref()
368 (void) pthread_mutex_unlock(&object->nwamd_object_mutex); in nwamd_object_decref()
370 (void) pthread_mutex_lock(&object->nwamd_object_mutex); in nwamd_object_decref()
371 if (--object->nwamd_object_refcount != 0) in nwamd_object_decref()
373 &object->nwamd_object_mutex); in nwamd_object_decref()
375 nwamd_object_fini(object, objtype); in nwamd_object_decref()
378 (void) pthread_mutex_unlock(&object->nwamd_object_mutex); in nwamd_object_decref()
387 nwamd_object_release_and_preserve(nwamd_object_t object) in nwamd_object_release_and_preserve() argument
389 (void) pthread_mutex_unlock(&object->nwamd_object_mutex); in nwamd_object_release_and_preserve()
393 nwamd_object_release(nwamd_object_t object) in nwamd_object_release() argument
395 nwamd_object_decref(object, 1); in nwamd_object_release()
399 nwamd_object_release_and_destroy(nwamd_object_t object) in nwamd_object_release_and_destroy() argument
401 nwamd_object_decref(object, 2); in nwamd_object_release_and_destroy()
405 nwamd_object_release_and_destroy_after_preserve(nwamd_object_t object) in nwamd_object_release_and_destroy_after_preserve() argument
407 nwamd_object_decref(object, 3); in nwamd_object_release_and_destroy_after_preserve()
411 nwamd_object_release_after_preserve(nwamd_object_t object) in nwamd_object_release_after_preserve() argument
413 nwamd_object_decref(object, 2); in nwamd_object_release_after_preserve()
453 nwamd_object_t object; in nwamd_walk_objects() local
460 for (object = uu_list_first(object_list->object_list); in nwamd_walk_objects()
461 object != NULL; in nwamd_walk_objects()
462 object = uu_list_next(object_list->object_list, object)) { in nwamd_walk_objects()
463 (void) pthread_mutex_lock(&object->nwamd_object_mutex); in nwamd_walk_objects()
464 ret = cb(object, data); in nwamd_walk_objects()
465 (void) pthread_mutex_unlock(&object->nwamd_object_mutex); in nwamd_walk_objects()