Lines Matching refs:sqh

1824 	sigqhdr_t *sqh;  in sigqsend()  local
1826 sqh = (sigqhdr_t *)sigqp->sq_backptr; in sigqsend()
1827 ASSERT(sqh); in sigqsend()
1829 mutex_enter(&sqh->sqb_lock); in sigqsend()
1830 sqh->sqb_sent++; in sigqsend()
1831 mutex_exit(&sqh->sqb_lock); in sigqsend()
2400 sigqhdr_t *sqh; in sigqhdralloc() local
2410 sqh = kmem_alloc(i, KM_SLEEP); in sigqhdralloc()
2411 sqh->sqb_count = maxcount; in sigqhdralloc()
2412 sqh->sqb_maxcount = maxcount; in sigqhdralloc()
2413 sqh->sqb_size = i; in sigqhdralloc()
2414 sqh->sqb_pexited = 0; in sigqhdralloc()
2415 sqh->sqb_sent = 0; in sigqhdralloc()
2416 sqh->sqb_free = sq = (sigqueue_t *)(sqh + 1); in sigqhdralloc()
2423 cv_init(&sqh->sqb_cv, NULL, CV_DEFAULT, NULL); in sigqhdralloc()
2424 mutex_init(&sqh->sqb_lock, NULL, MUTEX_DEFAULT, NULL); in sigqhdralloc()
2425 return (sqh); in sigqhdralloc()
2436 sigqalloc(sigqhdr_t *sqh) in sigqalloc() argument
2442 if (sqh != NULL) { in sigqalloc()
2443 mutex_enter(&sqh->sqb_lock); in sigqalloc()
2444 if (sqh->sqb_count > 0) { in sigqalloc()
2445 sqh->sqb_count--; in sigqalloc()
2446 if (sqh->sqb_free == NULL) { in sigqalloc()
2453 sq = sqh->sqb_free; in sigqalloc()
2455 sqh->sqb_free = sq->sq_next; in sigqalloc()
2457 mutex_exit(&sqh->sqb_lock); in sigqalloc()
2459 sq->sq_backptr = sqh; in sigqalloc()
2463 mutex_exit(&sqh->sqb_lock); in sigqalloc()
2475 sigqhdr_t *sqh; in sigqrel() local
2479 sqh = (sigqhdr_t *)sq->sq_backptr; in sigqrel()
2480 mutex_enter(&sqh->sqb_lock); in sigqrel()
2481 if (sqh->sqb_pexited && sqh->sqb_sent == 1) { in sigqrel()
2482 mutex_exit(&sqh->sqb_lock); in sigqrel()
2483 cv_destroy(&sqh->sqb_cv); in sigqrel()
2484 mutex_destroy(&sqh->sqb_lock); in sigqrel()
2485 kmem_free(sqh, sqh->sqb_size); in sigqrel()
2487 sqh->sqb_count++; in sigqrel()
2488 sqh->sqb_sent--; in sigqrel()
2489 sq->sq_next = sqh->sqb_free; in sigqrel()
2491 sqh->sqb_free = sq; in sigqrel()
2492 cv_signal(&sqh->sqb_cv); in sigqrel()
2493 mutex_exit(&sqh->sqb_lock); in sigqrel()
2521 sigqhdrfree(sigqhdr_t *sqh) in sigqhdrfree() argument
2523 mutex_enter(&sqh->sqb_lock); in sigqhdrfree()
2524 if (sqh->sqb_sent == 0) { in sigqhdrfree()
2525 mutex_exit(&sqh->sqb_lock); in sigqhdrfree()
2526 cv_destroy(&sqh->sqb_cv); in sigqhdrfree()
2527 mutex_destroy(&sqh->sqb_lock); in sigqhdrfree()
2528 kmem_free(sqh, sqh->sqb_size); in sigqhdrfree()
2530 sqh->sqb_pexited = 1; in sigqhdrfree()
2531 mutex_exit(&sqh->sqb_lock); in sigqhdrfree()