Confirmed users
753
edits
No edit summary |
|||
Line 88: | Line 88: | ||
* Read locks are non-exclusive, reference-counted, and recursive. This means that a single caller may issue N read locks on a single gralloc buffer handle, and then issue N unlocks to release the lock. | * Read locks are non-exclusive, reference-counted, and recursive. This means that a single caller may issue N read locks on a single gralloc buffer handle, and then issue N unlocks to release the lock. | ||
* Write locks are completely exclusive, both with any other write lock and also with any read lock. | * Write locks are completely exclusive, both with any other write lock and also with any read lock. | ||
* The following is somewhat speculative, not firmly established. If a buffer is already locked (for read or write) and an attempt is made to get a write lock on it, then: | * The following is somewhat speculative, not firmly established (QUESTION: so is it correct?). If a buffer is already locked (for read or write) and an attempt is made to get a write lock on it, then: | ||
** If the new write lock attempt is using the same handle to the gralloc buffer that is already locked, this will fail. This typically gives a message like "trying to upgrade a read lock to a write lock". | ** If the new write lock attempt is using the same handle to the gralloc buffer that is already locked, this will fail. This typically gives a message like "trying to upgrade a read lock to a write lock". | ||
** If the new write lock attempt is using a different handle than the one already locked, then this locking operation will wait until the existing lock is released. | ** If the new write lock attempt is using a different handle than the one already locked, then this locking operation will wait until the existing lock is released. |