Lines Matching full:lock
48 /* Internal function to map the userspace locks to the kernel lock types */
52 // If the user sets both a read and write lock, higher preference is
53 // given to the write lock.
66 /* Internal function to perform the actual lock/unlock operations */
80 ALOGE("%s: the lock has not been created,"
85 genlock_lock lock;
86 lock.op = lockType;
87 lock.flags = flags;
88 lock.timeout = timeout;
89 lock.fd = hnd->genlockHandle;
92 if (ioctl(hnd->genlockPrivFd, GENLOCK_IOC_DREADLOCK, &lock)) {
103 if (ioctl(hnd->genlockPrivFd, GENLOCK_IOC_LOCK, &lock)) {
136 * Create a genlock lock. The genlock lock file descriptor and the lock
161 // Create a new lock
162 genlock_lock lock;
166 close_genlock_fd_and_handle(fd, lock.fd);
170 // Export the lock for other processes to be able to use it.
172 if (ioctl(fd, GENLOCK_IOC_EXPORT, &lock)) {
175 close_genlock_fd_and_handle(fd, lock.fd);
180 // Store the lock params in the handle.
182 hnd->genlockHandle = lock.fd;
192 * Release a genlock lock associated with the handle.
209 ALOGE("%s: the lock is invalid", __FUNCTION__);
222 * Attach a lock to the buffer handle passed via an IPC.
246 // Attach the local handle to an existing lock
247 genlock_lock lock;
248 lock.fd = hnd->genlockHandle;
249 if (ioctl(fd, GENLOCK_IOC_ATTACH, &lock)) {
252 close_genlock_fd_and_handle(fd, lock.fd);
264 * Lock the buffer specified by the buffer handle. The lock held by the buffer
265 * is specified by the lockType. This function will block if a write lock is
271 * @param: type of lock to be acquired by the buffer.
289 ALOGW("%s: trying to lock a buffer with timeout = 0", __FUNCTION__);
291 // Call the private function to perform the lock operation specified.
316 * Blocks the calling process until the lock held on the handle is unlocked.
332 ALOGE("%s: the lock is invalid", __FUNCTION__);
339 genlock_lock lock;
340 lock.fd = hnd->genlockHandle;
341 lock.timeout = timeout;
342 if (ioctl(hnd->genlockPrivFd, GENLOCK_IOC_WAIT, &lock)) {
353 * Convert a write lock that we own to a read lock
364 ALOGW("%s: trying to lock a buffer with timeout = 0", __FUNCTION__);
366 // Call the private function to perform the lock operation specified.