Lines Matching +full:lock +full:- +full:status
3 * Module Name: utlock - Reader/Writer lock interfaces
11 * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
108 * any of its subsidiaries will export/re-export any technical data, process,
130 * 3. Neither the names of the above-listed copyright holders nor the names
165 * PARAMETERS: Lock - Pointer to a valid RW lock
167 * RETURN: Status
169 * DESCRIPTION: Reader/writer lock creation and deletion interfaces.
175 ACPI_RW_LOCK *Lock) in AcpiUtCreateRwLock() argument
177 ACPI_STATUS Status; in AcpiUtCreateRwLock() local
180 Lock->NumReaders = 0; in AcpiUtCreateRwLock()
181 Status = AcpiOsCreateMutex (&Lock->ReaderMutex); in AcpiUtCreateRwLock()
182 if (ACPI_FAILURE (Status)) in AcpiUtCreateRwLock()
184 return (Status); in AcpiUtCreateRwLock()
187 Status = AcpiOsCreateMutex (&Lock->WriterMutex); in AcpiUtCreateRwLock()
188 return (Status); in AcpiUtCreateRwLock()
194 ACPI_RW_LOCK *Lock) in AcpiUtDeleteRwLock() argument
197 AcpiOsDeleteMutex (Lock->ReaderMutex); in AcpiUtDeleteRwLock()
198 AcpiOsDeleteMutex (Lock->WriterMutex); in AcpiUtDeleteRwLock()
200 Lock->NumReaders = 0; in AcpiUtDeleteRwLock()
201 Lock->ReaderMutex = NULL; in AcpiUtDeleteRwLock()
202 Lock->WriterMutex = NULL; in AcpiUtDeleteRwLock()
211 * PARAMETERS: Lock - Pointer to a valid RW lock
213 * RETURN: Status
226 ACPI_RW_LOCK *Lock) in AcpiUtAcquireReadLock() argument
228 ACPI_STATUS Status; in AcpiUtAcquireReadLock() local
231 Status = AcpiOsAcquireMutex (Lock->ReaderMutex, ACPI_WAIT_FOREVER); in AcpiUtAcquireReadLock()
232 if (ACPI_FAILURE (Status)) in AcpiUtAcquireReadLock()
234 return (Status); in AcpiUtAcquireReadLock()
237 /* Acquire the write lock only for the first reader */ in AcpiUtAcquireReadLock()
239 Lock->NumReaders++; in AcpiUtAcquireReadLock()
240 if (Lock->NumReaders == 1) in AcpiUtAcquireReadLock()
242 Status = AcpiOsAcquireMutex (Lock->WriterMutex, ACPI_WAIT_FOREVER); in AcpiUtAcquireReadLock()
245 AcpiOsReleaseMutex (Lock->ReaderMutex); in AcpiUtAcquireReadLock()
246 return (Status); in AcpiUtAcquireReadLock()
252 ACPI_RW_LOCK *Lock) in AcpiUtReleaseReadLock() argument
254 ACPI_STATUS Status; in AcpiUtReleaseReadLock() local
257 Status = AcpiOsAcquireMutex (Lock->ReaderMutex, ACPI_WAIT_FOREVER); in AcpiUtReleaseReadLock()
258 if (ACPI_FAILURE (Status)) in AcpiUtReleaseReadLock()
260 return (Status); in AcpiUtReleaseReadLock()
263 /* Release the write lock only for the very last reader */ in AcpiUtReleaseReadLock()
265 Lock->NumReaders--; in AcpiUtReleaseReadLock()
266 if (Lock->NumReaders == 0) in AcpiUtReleaseReadLock()
268 AcpiOsReleaseMutex (Lock->WriterMutex); in AcpiUtReleaseReadLock()
271 AcpiOsReleaseMutex (Lock->ReaderMutex); in AcpiUtReleaseReadLock()
272 return (Status); in AcpiUtReleaseReadLock()
281 * PARAMETERS: Lock - Pointer to a valid RW lock
283 * RETURN: Status
286 * release the writer mutex associated with the lock. Acquisition
287 * of the lock is fully exclusive and will block all readers and
294 ACPI_RW_LOCK *Lock) in AcpiUtAcquireWriteLock() argument
296 ACPI_STATUS Status; in AcpiUtAcquireWriteLock() local
299 Status = AcpiOsAcquireMutex (Lock->WriterMutex, ACPI_WAIT_FOREVER); in AcpiUtAcquireWriteLock()
300 return (Status); in AcpiUtAcquireWriteLock()
306 ACPI_RW_LOCK *Lock) in AcpiUtReleaseWriteLock() argument
309 AcpiOsReleaseMutex (Lock->WriterMutex); in AcpiUtReleaseWriteLock()