1

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;
CL.
  • 173,858
  • 17
  • 217
  • 259
user1637056
  • 382
  • 3
  • 18

1 Answers1

1

Use the Source, Luke:

DEFINE_RWLOCK(lock);
CL.
  • 173,858
  • 17
  • 217
  • 259