Lines Matching refs:lock

62 acpi_status acpi_ut_create_rw_lock(struct acpi_rw_lock *lock)  in acpi_ut_create_rw_lock()  argument
66 lock->num_readers = 0; in acpi_ut_create_rw_lock()
67 status = acpi_os_create_mutex(&lock->reader_mutex); in acpi_ut_create_rw_lock()
72 status = acpi_os_create_mutex(&lock->writer_mutex); in acpi_ut_create_rw_lock()
76 void acpi_ut_delete_rw_lock(struct acpi_rw_lock *lock) in acpi_ut_delete_rw_lock() argument
79 acpi_os_delete_mutex(lock->reader_mutex); in acpi_ut_delete_rw_lock()
80 acpi_os_delete_mutex(lock->writer_mutex); in acpi_ut_delete_rw_lock()
82 lock->num_readers = 0; in acpi_ut_delete_rw_lock()
83 lock->reader_mutex = NULL; in acpi_ut_delete_rw_lock()
84 lock->writer_mutex = NULL; in acpi_ut_delete_rw_lock()
105 acpi_status acpi_ut_acquire_read_lock(struct acpi_rw_lock *lock) in acpi_ut_acquire_read_lock() argument
109 status = acpi_os_acquire_mutex(lock->reader_mutex, ACPI_WAIT_FOREVER); in acpi_ut_acquire_read_lock()
116 lock->num_readers++; in acpi_ut_acquire_read_lock()
117 if (lock->num_readers == 1) { in acpi_ut_acquire_read_lock()
119 acpi_os_acquire_mutex(lock->writer_mutex, in acpi_ut_acquire_read_lock()
123 acpi_os_release_mutex(lock->reader_mutex); in acpi_ut_acquire_read_lock()
127 acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock) in acpi_ut_release_read_lock() argument
131 status = acpi_os_acquire_mutex(lock->reader_mutex, ACPI_WAIT_FOREVER); in acpi_ut_release_read_lock()
138 lock->num_readers--; in acpi_ut_release_read_lock()
139 if (lock->num_readers == 0) { in acpi_ut_release_read_lock()
140 acpi_os_release_mutex(lock->writer_mutex); in acpi_ut_release_read_lock()
143 acpi_os_release_mutex(lock->reader_mutex); in acpi_ut_release_read_lock()
163 acpi_status acpi_ut_acquire_write_lock(struct acpi_rw_lock *lock) in acpi_ut_acquire_write_lock() argument
167 status = acpi_os_acquire_mutex(lock->writer_mutex, ACPI_WAIT_FOREVER); in acpi_ut_acquire_write_lock()
171 void acpi_ut_release_write_lock(struct acpi_rw_lock *lock) in acpi_ut_release_write_lock() argument
174 acpi_os_release_mutex(lock->writer_mutex); in acpi_ut_release_write_lock()