XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
DMtx.hxx
浏览该文件的文档.
1
13#ifndef __xwos_cxx_lock_DMtx_hxx__
14#define __xwos_cxx_lock_DMtx_hxx__
15
18
19namespace xwos {
20namespace lock {
21
72class DMtx
73{
74 public:
87 };
88
92 class Grd
93 {
94 private:
98
99 public:
100 Grd() = delete;
101
138 Grd(DMtx * mtx, enum LockMode mode = LockMode::DMtxLock, xwtm_t to = XWTM_MAX);
139
151
152
156 ~Grd();
157
170 xwer_t getRc() { return mRc; }
171
197 xwer_t wait(sync::Cond * cond);
198
208 xwer_t wait(sync::Cond & cond) { return wait(&cond); }
209
242 xwer_t wait(sync::Cond * cond, xwtm_t to);
243
254 xwer_t wait(sync::Cond & cond, xwtm_t to) { return wait(&cond, to); }
255 };
256
257 private:
261 public:
266 explicit DMtx(xwpr_t pr = XWOS_SKD_PRIORITY_RT_MAX);
267 ~DMtx();
268 xwer_t getCtorRc() { return mCtorRc; }
269 struct xwos_mtx * getXwosObj() { return mMtxDesc.mtx; }
271 /* 生命周期管理 */
274};
275
280} // namespace lock
281} // namespace xwos
282
283#endif /* xwos/cxx/lock/DMtx.hxx */
xwos::sync::Cond
动态互斥锁的RAII机制守卫
Definition DMtx.hxx:93
xwer_t wait(sync::Cond &cond, xwtm_t to)
限时等待条件量
Definition DMtx.hxx:254
xwer_t wait(sync::Cond *cond)
等待条件量
Definition DMtx.cxx:57
xwer_t wait(sync::Cond &cond)
等待条件量
Definition DMtx.hxx:208
Grd(DMtx &mtx, enum LockMode mode=LockMode::DMtxLock, xwtm_t to=XWTM_MAX)
构造动态互斥锁的RAII机制守卫并上锁互斥锁
xwer_t getRc()
获取上锁结果错误码
Definition DMtx.hxx:170
~Grd()
析构动态互斥锁的RAII机制守卫并解锁互斥锁
Definition DMtx.cxx:48
enum LockMode mLockMode
Definition DMtx.hxx:97
动态互斥锁
Definition DMtx.hxx:73
struct xwos_mtx * getXwosObj()
Definition DMtx.hxx:269
xwos_mtx_d mMtxDesc
Definition DMtx.hxx:258
LockMode
动态互斥锁的锁模式
Definition DMtx.hxx:78
@ DMtxLockUninterruptable
Definition DMtx.hxx:83
xwer_t release()
Definition DMtx.hxx:273
xwer_t mCtorRc
Definition DMtx.hxx:259
xwer_t getCtorRc()
Definition DMtx.hxx:268
xwer_t acquire()
Definition DMtx.hxx:272
条件量基类
Definition Cond.hxx:31
xws64_t xwtm_t
XWOS系统时间 (有符号)
Definition type.h:742
#define XWTM_MAX
xwtm_t 的最大值
Definition type.h:755
signed long xwer_t
Definition type.h:554
xws32_t xwpr_t
Definition type.h:534
uint32_t xwu32_t
Definition type.h:266
static xwer_t xwos_mtx_release(xwos_mtx_d mtxd)
XWOS API:检查对象的标签并减少引用计数
Definition mtx.h:231
static xwer_t xwos_mtx_acquire(xwos_mtx_d mtxd)
XWOS API:检查互斥锁对象的标签并增加引用计数
Definition mtx.h:214
#define XWOS_SKD_PRIORITY_RT_MAX
XWOS API:最大实时优先级
Definition skd.h:94
C++操作系统抽象层:互斥锁
Definition Cpu.hxx:19
XWOS API:互斥锁对象描述符
Definition mtx.h:89
struct xwos_mtx * mtx
Definition mtx.h:90
XWOS API:互斥锁
Definition mtx.h:82