Lines Matching refs:sem
630 sem_t *sem; in acpi_os_create_semaphore() local
643 sem = in acpi_os_create_semaphore()
646 if (!sem) { in acpi_os_create_semaphore()
653 sem = acpi_os_allocate(sizeof(sem_t)); in acpi_os_create_semaphore()
654 if (!sem) { in acpi_os_create_semaphore()
658 if (sem_init(sem, 0, initial_units) == -1) { in acpi_os_create_semaphore()
659 acpi_os_free(sem); in acpi_os_create_semaphore()
664 *out_handle = (acpi_handle)sem; in acpi_os_create_semaphore()
682 sem_t *sem = (sem_t *) handle; in acpi_os_delete_semaphore() local
684 if (!sem) { in acpi_os_delete_semaphore()
688 if (sem_close(sem) == -1) { in acpi_os_delete_semaphore()
692 if (sem_destroy(sem) == -1) { in acpi_os_delete_semaphore()
718 sem_t *sem = (sem_t *) handle; in acpi_os_wait_semaphore() local
724 if (!sem) { in acpi_os_wait_semaphore()
738 if (sem_trywait(sem) == -1) { in acpi_os_wait_semaphore()
747 while (((ret_val = sem_wait(sem)) == -1) && (errno == EINTR)) { in acpi_os_wait_semaphore()
765 if (sem_trywait(sem) == 0) { in acpi_os_wait_semaphore()
801 while (((ret_val = sem_timedwait(sem, &time)) == -1) in acpi_os_wait_semaphore()
835 sem_t *sem = (sem_t *) handle; in acpi_os_signal_semaphore() local
837 if (!sem) { in acpi_os_signal_semaphore()
841 if (sem_post(sem) == -1) { in acpi_os_signal_semaphore()