how to init rwlock_t

1.6k Views Asked by At

I am writing a linux kernel module, and I can't find a way to initialise my read-write lock. I prefer a static init.

When I try using RW_LOCK_UNLOCKED, the compiler tells me that it is not defined.

rwlock_t lock = RW_LOCK_UNLOCKED;
1

There are 1 best solutions below

0
On

Use the Source, Luke:

DEFINE_RWLOCK(lock);