更新日期: 2022/06/01 来源: https://gitee.com/weharmony/kernel_liteos_a_note
OsRwlock结构体 参考

#include <los_rwlock.h>

成员变量

INT32 magic:24
 
INT32 rwCount:8
 
VOID * writeOwner
 
LOS_DL_LIST readList
 
LOS_DL_LIST writeList
 

详细描述

Rwlock object.

在文件 los_rwlock.h52 行定义.

结构体成员变量说明

◆ magic

INT32 OsRwlock::magic

Magic number | 魔法数字 为什么要用魔法数字 ?

在文件 los_rwlock.h53 行定义.

◆ readList

LOS_DL_LIST OsRwlock::readList

Read waiting list | 等待读操作的任务链表

在文件 los_rwlock.h59 行定义.

◆ rwCount

INT32 OsRwlock::rwCount

Times of locking the rwlock, rwCount > 0 when rwkick is read mode, rwCount < 0 when the rwlock is write mode, rwCount = 0 when the lock is free. 大于0时为读模式 , 小于0时为写模式 等于0为自由模式 rwCount为读锁和写锁的数量,注意它们并不是此消彼长的行为模式

在文件 los_rwlock.h54 行定义.

◆ writeList

LOS_DL_LIST OsRwlock::writeList

Write waiting list | 等待写操作的任务链表

在文件 los_rwlock.h60 行定义.

◆ writeOwner

VOID* OsRwlock::writeOwner

The current write thread that is locking the rwlock | 拥有写权限的任务

在文件 los_rwlock.h58 行定义.


该结构体的文档由以下文件生成: