Lines Matching refs:cp
116 callb_t *cp;
123 if ((cp = ct->ct_freelist) == NULL) {
125 cp = (callb_t *)kmem_zalloc(sizeof (callb_t), KM_SLEEP);
127 ct->ct_freelist = cp->c_next;
128 cp->c_thread = t;
129 cp->c_func = func;
130 cp->c_arg = arg;
131 cp->c_class = (uchar_t)class;
132 cp->c_flag |= CALLB_TAKEN;
139 (void) strncpy(cp->c_name, name, CB_MAXNAME);
140 cp->c_name[CB_MAXNAME] = '\0';
145 cp->c_next = ct->ct_first_cb[class];
146 ct->ct_first_cb[class] = cp;
149 return ((callb_id_t)cp);
235 callb_t *cp;
242 for (cp = ct->ct_first_cb[class];
243 cp != NULL && ret == 0; cp = cp->c_next) {
244 while (cp->c_flag & CALLB_EXECUTING)
245 cv_wait(&cp->c_done_cv, &ct->ct_lock);
249 if (cp->c_flag == CALLB_FREE)
251 cp->c_flag |= CALLB_EXECUTING;
255 cp->c_name, (void *)cp->c_func, (void *)cp->c_arg);
260 if (!(*cp->c_func)(cp->c_arg, code))
261 ret = cp->c_name;
264 cp->c_flag &= ~CALLB_EXECUTING;
265 cv_broadcast(&cp->c_done_cv);
286 callb_cpr_t *cp = (callb_cpr_t *)arg;
289 mutex_enter(cp->cc_lockp);
293 cp->cc_events |= CALLB_CPR_START;
295 while (!(cp->cc_events & CALLB_CPR_SAFE))
297 if ((ret = cv_reltimedwait(&cp->cc_callb_cv,
298 cp->cc_lockp, (callb_timeout_sec * hz),
305 cp->cc_events &= ~CALLB_CPR_START;
306 cv_signal(&cp->cc_stop_cv);
309 mutex_exit(cp->cc_lockp);
356 callb_t *cp;
361 for (cp = ct->ct_first_cb[CB_CL_CPR_DAEMON];
362 cp != NULL && tp != cp->c_thread; cp = cp->c_next)
365 ret_val = (cp != NULL);
372 callb_cpr_t *ccp = (callb_cpr_t *)cp->c_arg;
374 *thread_name = cp->c_name; /* in case not stopped */