summaryrefslogtreecommitdiffstats
path: root/include/hardware/gralloc.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-05-05 20:21:57 -0700
committerMathias Agopian <mathias@google.com>2009-05-05 20:49:49 -0700
commit485e69809aef8bf301b6bf19c03dc2d7693aaa1a (patch)
tree58775a86be0138fca964c5ec9858b1177d4da3d9 /include/hardware/gralloc.h
parent295190f426a209cf08a21476f15e0e281db6fcb5 (diff)
downloadhardware_libhardware-485e69809aef8bf301b6bf19c03dc2d7693aaa1a.zip
hardware_libhardware-485e69809aef8bf301b6bf19c03dc2d7693aaa1a.tar.gz
hardware_libhardware-485e69809aef8bf301b6bf19c03dc2d7693aaa1a.tar.bz2
better documentation and implementation for lock/unlock
Diffstat (limited to 'include/hardware/gralloc.h')
-rw-r--r--include/hardware/gralloc.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/hardware/gralloc.h b/include/hardware/gralloc.h
index 6bde8f7..dba6fda 100644
--- a/include/hardware/gralloc.h
+++ b/include/hardware/gralloc.h
@@ -131,6 +131,18 @@ struct gralloc_module_t {
* If usage specifies GRALLOC_USAGE_SW_*, vaddr is filled with the address
* of the buffer in virtual memory.
*
+ * THREADING CONSIDERATIONS:
+ *
+ * It is legal for several different threads to lock a buffer from
+ * read access, none of the threads are blocked.
+ *
+ * However, locking a buffer simultaneously for write or read/write is
+ * undefined, but:
+ * - shall not result in termination of the process
+ * - shall not block the caller
+ * It is acceptable to return an error or to leave the buffer's content
+ * into an indeterminate state.
+ *
* If the buffer was created with a usage mask incompatible with the
* requested usage flags here, -EINVAL is returned.
*