Lines Matching refs:sqh
1808 sigqhdr_t *sqh; in sigqsend() local
1810 sqh = (sigqhdr_t *)sigqp->sq_backptr; in sigqsend()
1811 ASSERT(sqh); in sigqsend()
1813 mutex_enter(&sqh->sqb_lock); in sigqsend()
1814 sqh->sqb_sent++; in sigqsend()
1815 mutex_exit(&sqh->sqb_lock); in sigqsend()
2384 sigqhdr_t *sqh; in sigqhdralloc() local
2394 sqh = kmem_alloc(i, KM_SLEEP); in sigqhdralloc()
2395 sqh->sqb_count = maxcount; in sigqhdralloc()
2396 sqh->sqb_maxcount = maxcount; in sigqhdralloc()
2397 sqh->sqb_size = i; in sigqhdralloc()
2398 sqh->sqb_pexited = 0; in sigqhdralloc()
2399 sqh->sqb_sent = 0; in sigqhdralloc()
2400 sqh->sqb_free = sq = (sigqueue_t *)(sqh + 1); in sigqhdralloc()
2407 cv_init(&sqh->sqb_cv, NULL, CV_DEFAULT, NULL); in sigqhdralloc()
2408 mutex_init(&sqh->sqb_lock, NULL, MUTEX_DEFAULT, NULL); in sigqhdralloc()
2409 return (sqh); in sigqhdralloc()
2420 sigqalloc(sigqhdr_t *sqh) in sigqalloc() argument
2426 if (sqh != NULL) { in sigqalloc()
2427 mutex_enter(&sqh->sqb_lock); in sigqalloc()
2428 if (sqh->sqb_count > 0) { in sigqalloc()
2429 sqh->sqb_count--; in sigqalloc()
2430 if (sqh->sqb_free == NULL) { in sigqalloc()
2437 sq = sqh->sqb_free; in sigqalloc()
2439 sqh->sqb_free = sq->sq_next; in sigqalloc()
2441 mutex_exit(&sqh->sqb_lock); in sigqalloc()
2443 sq->sq_backptr = sqh; in sigqalloc()
2447 mutex_exit(&sqh->sqb_lock); in sigqalloc()
2459 sigqhdr_t *sqh; in sigqrel() local
2463 sqh = (sigqhdr_t *)sq->sq_backptr; in sigqrel()
2464 mutex_enter(&sqh->sqb_lock); in sigqrel()
2465 if (sqh->sqb_pexited && sqh->sqb_sent == 1) { in sigqrel()
2466 mutex_exit(&sqh->sqb_lock); in sigqrel()
2467 cv_destroy(&sqh->sqb_cv); in sigqrel()
2468 mutex_destroy(&sqh->sqb_lock); in sigqrel()
2469 kmem_free(sqh, sqh->sqb_size); in sigqrel()
2471 sqh->sqb_count++; in sigqrel()
2472 sqh->sqb_sent--; in sigqrel()
2473 sq->sq_next = sqh->sqb_free; in sigqrel()
2475 sqh->sqb_free = sq; in sigqrel()
2476 cv_signal(&sqh->sqb_cv); in sigqrel()
2477 mutex_exit(&sqh->sqb_lock); in sigqrel()
2505 sigqhdrfree(sigqhdr_t *sqh) in sigqhdrfree() argument
2507 mutex_enter(&sqh->sqb_lock); in sigqhdrfree()
2508 if (sqh->sqb_sent == 0) { in sigqhdrfree()
2509 mutex_exit(&sqh->sqb_lock); in sigqhdrfree()
2510 cv_destroy(&sqh->sqb_cv); in sigqhdrfree()
2511 mutex_destroy(&sqh->sqb_lock); in sigqhdrfree()
2512 kmem_free(sqh, sqh->sqb_size); in sigqhdrfree()
2514 sqh->sqb_pexited = 1; in sigqhdrfree()
2515 mutex_exit(&sqh->sqb_lock); in sigqhdrfree()