当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 1 Fork 5.3K

fork_ohos_wj / docs
关闭

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

hdf_workqueue.h

Overview

Related Modules:

DriverUtils

Description:

Declares work queue structures and interfaces.

This file provides interfaces such as initializing a work queue, a work item, and a delayed work item, adding a work or delayed work item to a work queue, and destroying a work queue, a work item, and a delayed work item. You need to define a work queue, a work item, and a delayed work item, and then call the initialization function to initialize them. The work item, delayed work item, and work queue must be destroyed when they are no longer used.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

HdfWork

Describes a work item and a delayed work item. This structure defines the work and delayed work items, and then calls the initialization function HdfWorkInit or HdfDelayedWorkInit to perform initialization. The HdfAddWork() function is to add a work item to a work queue immediately, and the HdfAddDelayedWork() function is to add a work item to a work queue after the configured delayed time.

HdfWorkQueue

Describes a work queue.

Typedefs

Typedef Name

Description

HdfWorkFunc) (void *)

typedef void(* 

Describes a work execution function type.

Enumerations

Enumeration Name

Description

{ HDF_WORK_BUSY_PENDING = 1 << 0, HDF_WORK_BUSY_RUNNING = 1 << 1 }

Enumerates statuses of a work item or a delayed work item.

Functions

Function Name

Description

HdfWorkQueueInit (HdfWorkQueue *queue, char *name)

int32_t 

Initializes a work queue.

HdfWorkInit (HdfWork *work, HdfWorkFunc func, void *arg)

int32_t 

Initializes a work item.

HdfDelayedWorkInit (HdfWork *work, HdfWorkFunc func, void *arg)

int32_t 

Initializes a delayed work item.

HdfWorkDestroy (HdfWork *work)

void 

Destroys a work item.

HdfWorkQueueDestroy (HdfWorkQueue *queue)

void 

Destroys a work queue.

HdfDelayedWorkDestroy (HdfWork *work)

void 

Destroys a delayed work item.

HdfAddWork (HdfWorkQueue *queue, HdfWork *work)

bool 

Adds a work item to a work queue.

HdfAddDelayedWork (HdfWorkQueue *queue, HdfWork *work, unsigned long ms)

bool 

Adds a delayed work item to a work queue.

HdfWorkBusy (HdfWork *work)

unsigned int 

Obtains the status of a work item or delayed work item.

HdfCancelWorkSync (HdfWork *work)

bool 

Cancels a work item. This function waits until the work item is complete.

HdfCancelDelayedWorkSync (HdfWork *work)

bool 

Cancels a delayed work item.

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

搜索帮助

344bd9b3 5694891 D2dac590 5694891