Lines Matching defs:lsp
85 lwp_sema_t *lsp = (lwp_sema_t *)sp;
102 self->ul_wchan = lsp;
105 self->ul_td_evbuf.eventdata = lsp;
109 if (ssp && lsp->count == 0) {
111 if (lsp->count == 0) /* still looks like sleep */
117 if (lsp->type == USYNC_PROCESS) { /* kernel-level */
123 error = ___lwp_sema_timedwait(lsp, tsp, 1);
126 lsp->count != 0) { /* and non-blocking */
133 lsp->count--;
140 qp = queue_lock(lsp, CV);
141 while (error == 0 && lsp->count == 0) {
147 lsp->sema_waiters = 1;
160 qp = queue_lock(lsp, CV);
162 lsp->sema_waiters = dequeue_self(qp);
165 lsp->count--;
166 if (lsp->count != 0 && lsp->sema_waiters) {
172 lsp->sema_waiters = more;
186 count = lsp->count;
232 lwp_sema_t *lsp = (lwp_sema_t *)sp;
244 if (lsp->type == USYNC_PROCESS) { /* kernel-level */
245 error = _lwp_sema_trywait(lsp);
248 if (lsp->count == 0)
251 lsp->count--;
258 qp = queue_lock(lsp, CV);
259 if (lsp->count == 0)
261 else if (--lsp->count != 0 && lsp->sema_waiters) {
267 lsp->sema_waiters = more;
279 count = lsp->count;
299 lwp_sema_t *lsp = (lwp_sema_t *)sp;
311 if (lsp->type == USYNC_PROCESS) { /* kernel-level */
312 error = _lwp_sema_post(lsp);
315 if (lsp->count >= _semvaluemax)
318 lsp->count++;
325 qp = queue_lock(lsp, CV);
326 if (lsp->count >= _semvaluemax)
328 else if (lsp->count++ == 0 && lsp->sema_waiters) {
334 lsp->sema_waiters = more;
346 count = lsp->count;