1 Star 0 Fork 5.4K

OpenHarmony_EU incubator / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
semaphore-h.md 8.60 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

semaphore.h

Overview

Related Modules:

IPC

Description:

Provides functions and structures related to semaphore operations.

For example, you can use the functions to create, open, close, and delete semaphores, and perform P and V operations on semaphores.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

sem_t

Defines semaphores.

Macros

Macro Name and Value

Description

SEM_FAILED ((sem_t *)0)

Defines the semaphore failure flag.

Functions

Function Name

Description

sem_close (sem_t *sem)

int

Closes a specified semaphore.

sem_destroy (sem_t *sem)

int

Destroys a specified anonymous semaphore that is no longer used.

sem_getvalue (sem_t *__restrict sem, int *__restrict sval)

int

Obtains the count value of a specified semaphore.

sem_init (sem_t *sem, int pshared, unsigned int value)

int

Creates and initializes an anonymous semaphore.

sem_post (sem_t *sem)

int

Increments the semaphore count by 1.

sem_timedwait (sem_t *__restrict sem, const struct timespec *__restrict timeout)

int

Obtains the semaphore, with a timeout period specified.

sem_trywait (sem_t *sem)

int

Attempts to obtain the semaphore.

sem_unlink (const char *name)

int

Deletes a specified semaphore.

sem_wait (sem_t *sem)

int

Obtains the semaphore.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/open-harmony-eu-incubator/docs.git
git@gitee.com:open-harmony-eu-incubator/docs.git
open-harmony-eu-incubator
docs
docs
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891