Lines Matching defs:base
55 * an nsw state without base does not reference
95 /* remove reference to the nsw state base */
96 if (s->base != NULL) {
97 _nscd_release((nscd_acc_data_t *)s->base);
98 s->base = NULL;
111 nscd_nsw_state_base_t *base = (nscd_nsw_state_base_t *)data;
117 (me, "freeing db state base %p\n", base);
119 if (base == NULL)
124 s = base->nsw_state.first;
126 s = base->nsw_state_thr.first;
136 (me, "nsw state base %p freed \n", base);
142 nscd_nsw_state_base_t *base;
147 (me, "freeing all db state base\n");
152 base = nscd_nsw_state_base[i];
155 (me, "freeing db state base (%d) %p \n", i, base);
157 if (base == NULL)
161 _nscd_set((nscd_acc_data_t *)base, NULL);
390 nscd_nsw_state_base_t *base;
411 (me, "no base nsw config created for %s (sources: %s)\n",
500 base = nscd_nsw_state_base[dbi];
502 if (base == NULL)
503 assert(base != NULL);
511 assert(base == (nscd_nsw_state_base_t *)_nscd_mutex_lock(
512 (nscd_acc_data_t *)base));
515 ctrl_p = &base->nsw_state;
518 ctrl_p = &base->nsw_state_thr;
523 _nscd_logit(me, "tid in base = %d\n", base->tid);
538 else if (thread_only && base->used_by_thr && base->tid != *tid)
557 _nscd_cond_wait((nscd_acc_data_t *)base,
558 &base->thr_cond);
560 if (base->used_by_thr == 0 &&
564 _nscd_cond_wait((nscd_acc_data_t *)base, NULL);
623 _nscd_mutex_unlock((nscd_acc_data_t *)base);
635 base->tid = *tid;
636 base->used_by_thr = 1;
642 _nscd_logit(me, "tid in base = %d\n", base->tid);
658 * reference count the nsswitch state base bfore handing out
661 ret->base = (nscd_nsw_state_base_t *)
662 _nscd_get((nscd_acc_data_t *)base);
664 _nscd_mutex_unlock((nscd_acc_data_t *)base);
695 nscd_nsw_state_base_t *base;
710 * no need to put back if the nsw state is not on any base
715 (me, "no base nsw state, freeing resources ...\n");
724 base = s->base;
726 if (_nscd_mutex_lock((nscd_acc_data_t *)base) == NULL) {
727 /* base has been freed or no longer valid, free the nsw state */
729 (me, "nsw state base gone or no longer valid, freeing %p\n", s);
735 ctrl_p = &base->nsw_state_thr;
737 ctrl_p = &base->nsw_state;
742 _nscd_logit(me, "tid in base = %d\n", base->tid);
762 * Remove reference to the nsswitch state base.
764 _nscd_release((nscd_acc_data_t *)base);
765 s->base = NULL;
772 base->used_by_thr = 0;
774 (void) cond_signal(&base->thr_cond);
780 _nscd_cond_signal((nscd_acc_data_t *)base);
786 _nscd_logit(me, "tid in base = %d\n", base->tid);
800 _nscd_mutex_unlock((nscd_acc_data_t *)base);
826 nscd_nsw_state_base_t *base = NULL;
832 base = (nscd_nsw_state_base_t *)_nscd_alloc(
838 if (base == NULL) {
841 (me, "not able to allocate a nsw state base\n");
847 (me, "nsw state base %p allocated\n", base);
850 * initialize and activate the new nss_nsw_state base
852 base->dbi = dbi;
858 base->nsw_state.max = NSCD_SW_CFG(cfgdbi).max_nsw_state_per_db;
859 base->nsw_state_thr.max = NSCD_SW_CFG(cfgdbi).max_nsw_state_per_thread;
863 (nscd_acc_data_t *)base);
888 "base (%d)\n", i);
895 (me, "all nsw state base initialized\n");