XWOS API
4.0
XWOS C/C++ API参考手册
|
操作系统抽象层:互斥锁 更多...
#include <xwos/standard.h>
#include <xwos/osal/jack/lock/mtx.h>
#include <xwos/osal/time.h>
#include <xwos/osal/skd.h>
结构体 | |
struct | xwos_mtx |
XWOS API:互斥锁 更多... | |
struct | xwos_mtx_d |
XWOS API:互斥锁对象描述符 更多... | |
宏定义 | |
#define | XWOS_MTX_NILD ((xwos_mtx_d){NULL, 0,}) |
XWOS API:空的互斥锁对象描述符 | |
函数 | |
static xwer_t | xwos_mtx_init (struct xwos_mtx *mtx, xwpr_t sprio) |
XWOS API:静态方式初始化互斥锁 | |
static xwer_t | xwos_mtx_fini (struct xwos_mtx *mtx) |
XWOS API:销毁静态方式初始化的互斥锁 | |
static xwer_t | xwos_mtx_grab (struct xwos_mtx *mtx) |
XWOS API:增加互斥锁对象的引用计数 | |
static xwer_t | xwos_mtx_put (struct xwos_mtx *mtx) |
XWOS API:减少互斥锁对象的引用计数 | |
static xwer_t | xwos_mtx_create (xwos_mtx_d *mtxd, xwpr_t sprio) |
XWOS API:动态方式创建互斥锁 | |
static xwer_t | xwos_mtx_delete (xwos_mtx_d mtxd) |
XWOS API:删除动态方式创建的互斥锁 | |
static xwer_t | xwos_mtx_acquire (xwos_mtx_d mtxd) |
XWOS API:检查互斥锁对象的标签并增加引用计数 | |
static xwer_t | xwos_mtx_release (xwos_mtx_d mtxd) |
XWOS API:检查对象的标签并减少引用计数 | |
static xwsq_t | xwos_mtx_get_tik (struct xwos_mtx *mtx) |
XWOS API:获取互斥锁对象的标签 | |
static xwos_mtx_d | xwos_mtx_get_d (struct xwos_mtx *mtx) |
XWOS API:获取互斥锁对象的描述符 | |
static xwer_t | xwos_mtx_unlock (struct xwos_mtx *mtx) |
XWOS API:解锁互斥锁 | |
static xwer_t | xwos_mtx_lock (struct xwos_mtx *mtx) |
XWOS API:等待并上锁互斥锁 | |
static xwer_t | xwos_mtx_lock_to (struct xwos_mtx *mtx, xwtm_t to) |
XWOS API:限时等待上锁互斥锁 | |
static xwer_t | xwos_mtx_lock_unintr (struct xwos_mtx *mtx) |
XWOS API:等待并上锁互斥锁,且等待不可被中断 | |
static xwer_t | xwos_mtx_trylock (struct xwos_mtx *mtx) |
XWOS API:尝试上锁互斥锁,不会阻塞调用线程 | |
static xwer_t | xwos_mtx_get_status (struct xwos_mtx *mtx, xwsq_t *lkst) |
XWOS API:获取锁的状态 | |
操作系统抽象层:互斥锁
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
在文件 mtx.h 中定义.