Lines Matching +defs:val +defs:sp
151 struct childstat *sp;
208 if ((sp = malloc(sizeof (struct childstat))) == NULL) {
215 * From this point on, both hp and sp are cleaned up and freed via
220 sp->hp = hp;
223 sp->synchflag = B_TRUE;
225 sp->synchflag = B_FALSE;
226 sp->done = B_FALSE;
227 sp->ret = 0;
228 sp->nusers = 1;
229 (void) mutex_init(&sp->m, USYNC_THREAD, 0);
230 (void) cond_init(&sp->cv, USYNC_THREAD, 0);
236 (void *) sp, THR_DAEMON|THR_DETACHED, &tid)) {
238 childstat_cleanup(sp);
244 if (!sp->done) { /* we might already have finished */
245 (void) mutex_lock(&sp->m);
248 if ((!sp->done) && (timeout == 0)) {
249 sp->nusers--;
250 (void) mutex_unlock(&sp->m);
256 while (!sp->done)
257 if (cond_timedwait(&sp->cv, &sp->m, &t) == ETIME) {
261 * assert(sp->nusers > 1);
277 if (sp->nusers == 1)
282 sp->nusers--;
283 (void) mutex_unlock(&sp->m);
287 assert(sp->done);
288 ret = sp->ret;
291 childstat_cleanup(sp);
307 struct childstat *sp;
311 sp = (struct childstat *)arg;
313 (void) mutex_lock(&sp->m);
321 if ((++sp->nusers == 1) && sp->synchflag) {
322 childstat_cleanup(sp);
326 (void) mutex_unlock(&sp->m);
328 hp = sp->hp;
358 (void) mutex_lock(&sp->m);
359 if (--sp->nusers == 0) {
361 childstat_cleanup(sp);
363 sp->done = B_TRUE;
364 sp->ret = num_updated;
365 (void) cond_signal(&sp->cv);
366 (void) mutex_unlock(&sp->m);
855 unsigned short val;
857 val = (p[0] << 8) | p[1];
859 return (val);
870 unsigned int val;
872 val = ((uint_t)p[0] << 24) | ((uint_t)p[1] << 16) |
875 return (val);
883 childstat_cleanup(struct childstat *sp)
885 (void) cond_destroy(&sp->cv);
886 (void) mutex_destroy(&sp->m);
887 freehost(sp->hp);
888 free(sp);