Lines Matching defs:rnip
1172 rc_notify_info_interested(rc_notify_info_t *rnip, rc_notify_t *np)
1190 if (rnip->rni_namelist[i] != NULL) {
1191 if (strcmp(nnp->rn_name, rnip->rni_namelist[i]) == 0)
1194 if (rnip->rni_typelist[i] != NULL) {
1195 if (strcmp(nnp->rn_type, rnip->rni_typelist[i]) == 0)
7352 rc_notify_info_init(rc_notify_info_t *rnip)
7356 uu_list_node_init(rnip, &rnip->rni_list_node, rc_notify_info_pool);
7357 uu_list_node_init(&rnip->rni_notify, &rnip->rni_notify.rcn_list_node,
7360 rnip->rni_notify.rcn_node = NULL;
7361 rnip->rni_notify.rcn_info = rnip;
7363 bzero(rnip->rni_namelist, sizeof (rnip->rni_namelist));
7364 bzero(rnip->rni_typelist, sizeof (rnip->rni_typelist));
7366 (void) pthread_cond_init(&rnip->rni_cv, NULL);
7369 rnip->rni_namelist[i] = NULL;
7370 rnip->rni_typelist[i] = NULL;
7375 rc_notify_info_insert_locked(rc_notify_info_t *rnip)
7379 assert(!(rnip->rni_flags & RC_NOTIFY_ACTIVE));
7381 rnip->rni_flags |= RC_NOTIFY_ACTIVE;
7382 (void) uu_list_insert_after(rc_notify_info_list, NULL, rnip);
7383 (void) uu_list_insert_before(rc_notify_list, NULL, &rnip->rni_notify);
7387 rc_notify_info_remove_locked(rc_notify_info_t *rnip)
7389 rc_notify_t *me = &rnip->rni_notify;
7394 assert(rnip->rni_flags & RC_NOTIFY_ACTIVE);
7396 assert(!(rnip->rni_flags & RC_NOTIFY_DRAIN));
7397 rnip->rni_flags |= RC_NOTIFY_DRAIN;
7398 (void) pthread_cond_broadcast(&rnip->rni_cv);
7400 (void) uu_list_remove(rc_notify_info_list, rnip);
7420 while (rnip->rni_waiters) {
7422 (void) pthread_cond_broadcast(&rnip->rni_cv);
7423 (void) pthread_cond_wait(&rnip->rni_cv, &rc_pg_notify_lock);
7426 rnip->rni_flags &= ~(RC_NOTIFY_DRAIN | RC_NOTIFY_ACTIVE);
7430 rc_notify_info_add_watch(rc_notify_info_t *rnip, const char **arr,
7447 while (rnip->rni_flags & RC_NOTIFY_EMPTYING)
7448 (void) pthread_cond_wait(&rnip->rni_cv, &rc_pg_notify_lock);
7472 if (!(rnip->rni_flags & RC_NOTIFY_ACTIVE))
7473 rc_notify_info_insert_locked(rnip);
7480 rc_notify_info_add_name(rc_notify_info_t *rnip, const char *name)
7482 return (rc_notify_info_add_watch(rnip, rnip->rni_namelist, name));
7486 rc_notify_info_add_type(rc_notify_info_t *rnip, const char *type)
7488 return (rc_notify_info_add_watch(rnip, rnip->rni_typelist, type));
7492 * Wait for and report an event of interest to rnip, a notification client
7495 rc_notify_info_wait(rc_notify_info_t *rnip, rc_node_ptr_t *out,
7499 rc_notify_t *me = &rnip->rni_notify;
7510 while ((rnip->rni_flags & (RC_NOTIFY_ACTIVE | RC_NOTIFY_DRAIN)) ==
7520 rnip->rni_waiters++;
7523 rnip->rni_waiters--;
7531 while (np != NULL && !rc_notify_info_interested(rnip, np)) {
7552 rnip->rni_waiters++;
7553 (void) pthread_cond_wait(&rnip->rni_cv,
7555 rnip->rni_waiters--;
7616 if (rnip->rni_waiters == 0)
7617 (void) pthread_cond_broadcast(&rnip->rni_cv);
7623 rc_notify_info_reset(rc_notify_info_t *rnip)
7628 if (rnip->rni_flags & RC_NOTIFY_ACTIVE)
7629 rc_notify_info_remove_locked(rnip);
7630 assert(!(rnip->rni_flags & (RC_NOTIFY_DRAIN | RC_NOTIFY_EMPTYING)));
7631 rnip->rni_flags |= RC_NOTIFY_EMPTYING;
7635 if (rnip->rni_namelist[i] != NULL) {
7636 free((void *)rnip->rni_namelist[i]);
7637 rnip->rni_namelist[i] = NULL;
7639 if (rnip->rni_typelist[i] != NULL) {
7640 free((void *)rnip->rni_typelist[i]);
7641 rnip->rni_typelist[i] = NULL;
7646 rnip->rni_flags &= ~RC_NOTIFY_EMPTYING;
7651 rc_notify_info_fini(rc_notify_info_t *rnip)
7653 rc_notify_info_reset(rnip);
7655 uu_list_node_fini(rnip, &rnip->rni_list_node, rc_notify_info_pool);
7656 uu_list_node_fini(&rnip->rni_notify, &rnip->rni_notify.rcn_list_node,