Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个 linux 内核模块,但找不到初始化读写锁的方法。我更喜欢静态初始化。
当我尝试使用 RW_LOCK_UNLOCKED 时,编译器告诉我它没有定义。
rwlock_t lock = RW_LOCK_UNLOCKED;
使用来源,卢克:
DEFINE_RWLOCK(lock);