---
title: IORWLockRead
framework: kernel
role: symbol
role_heading: Function
path: kernel/1553004-iorwlockread
---

# IORWLockRead

Lock a read/write lock for read.

## Declaration

```occ
void IORWLockRead(struct IORWLock *lock);
```

```occ
void IORWLockRead(IORWLock *lock);
```

## Parameters

- `lock`: Pointer to the allocated lock.

## Discussion

Discussion Lock the lock for read, allowing multiple readers when there are no writers. If the lock is held for write, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. Locking the lock recursively from one thread, for read or write, can result in deadlock.

## See Also

### Read/Write Locks

- [IORWLockAlloc](kernel/1553010-iorwlockalloc.md)
- [IORWLockFree](kernel/1553003-iorwlockfree.md)
- [IORWLockGetMachLock](kernel/1553033-iorwlockgetmachlock.md)
- [IORWLockUnlock](kernel/1553011-iorwlockunlock.md)
- [IORWLockWrite](kernel/1552996-iorwlockwrite.md)
- [IORWUnlock](kernel/1553027-iorwunlock.md)
- [IOWriteLock](kernel/1552985-iowritelock.md)
- [IOReadLock](kernel/1553022-ioreadlock.md)
