XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
SMtx.hxx
浏览该文件的文档.
1
13#ifndef __xwos_cxx_lock_SMtx_hxx__
14#define __xwos_cxx_lock_SMtx_hxx__
15
17#include <xwos/cxx/lock/Mtx.hxx>
19
20namespace xwos {
21namespace lock {
22
33class SMtx : public Mtx
34{
35 private:
36 struct xwos_mtx mMtx;
38 public:
44 : Mtx()
45 {
46 xwos_mtx_init(&mMtx, pr);
48 }
49
52 /* 生命周期管理 */
53 xwer_t grab() { return xwos_mtx_grab(&mMtx); }
54 xwer_t put() { return xwos_mtx_put(&mMtx); }
55};
56
61} // namespace lock
62} // namespace xwos
63
64#endif /* xwos/cxx/lock/SMtx.hxx */
xwos::sync::Cond
xwos::lock::Mtx
互斥锁基类
Definition Mtx.hxx:87
struct xwos_mtx * mMtxPtr
Definition Mtx.hxx:270
静态互斥锁
Definition SMtx.hxx:34
xwer_t put()
Definition SMtx.hxx:54
xwer_t grab()
Definition SMtx.hxx:53
SMtx(xwpr_t pr=XWOS_SKD_PRIORITY_RT_MAX)
构造函数
Definition SMtx.hxx:43
struct xwos_mtx mMtx
Definition SMtx.hxx:36
signed long xwer_t
Definition type.h:554
xws32_t xwpr_t
Definition type.h:534
static xwer_t xwos_mtx_init(struct xwos_mtx *mtx, xwpr_t sprio)
XWOS API:静态方式初始化互斥锁
Definition mtx.h:107
static xwer_t xwos_mtx_grab(struct xwos_mtx *mtx)
XWOS API:增加互斥锁对象的引用计数
Definition mtx.h:141
static xwer_t xwos_mtx_fini(struct xwos_mtx *mtx)
XWOS API:销毁静态方式初始化的互斥锁
Definition mtx.h:122
static xwer_t xwos_mtx_put(struct xwos_mtx *mtx)
XWOS API:减少互斥锁对象的引用计数
Definition mtx.h:160
#define XWOS_SKD_PRIORITY_RT_MAX
XWOS API:最大实时优先级
Definition skd.h:96
C++操作系统抽象层:互斥锁
Definition Bmp.hxx:21
XWOS API:互斥锁
Definition mtx.h:78