mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-07-22 12:15:55 -04:00
c23a461811
Signed-off-by: zhang <zhangfengxi@huawei.com>
39 lines
1001 B
C
Executable File
39 lines
1001 B
C
Executable File
/*
|
|
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
|
*
|
|
* HDF is dual licensed: you can use it either under the terms of
|
|
* the GPL, or the BSD license, at your option.
|
|
* See the LICENSE file in the root of this repository for complete details.
|
|
*/
|
|
|
|
#ifndef HDF_TASK_QUEUE_H
|
|
#define HDF_TASK_QUEUE_H
|
|
|
|
#include "hdf_dlist.h"
|
|
#include "osal_sem.h"
|
|
#include "osal_mutex.h"
|
|
#include "osal_thread.h"
|
|
|
|
struct HdfTaskType;
|
|
typedef int32_t (*HdfTaskFunc)(struct HdfTaskType *para);
|
|
|
|
struct HdfTaskType {
|
|
struct DListHead node;
|
|
HdfTaskFunc func;
|
|
};
|
|
|
|
struct HdfTaskQueue {
|
|
struct OsalSem sem;
|
|
struct OsalMutex mutex;
|
|
struct DListHead head;
|
|
struct OsalThread thread;
|
|
bool threadRunFlag;
|
|
HdfTaskFunc queueFunc;
|
|
const char *queueName;
|
|
};
|
|
|
|
void HdfTaskEnqueue(struct HdfTaskQueue *queue, struct HdfTaskType *task);
|
|
struct HdfTaskQueue *HdfTaskQueueCreate(HdfTaskFunc queueFunc, const char *name);
|
|
void HdfTaskQueueDestroy(struct HdfTaskQueue *queue);
|
|
|
|
#endif /* HDF_TASK_QUEUE_H */ |