harmony 鸿蒙type_def.h

  • 2025-06-12
  • 浏览 (4)

type_def.h

Overview

The type_def.h file declares the common types.

File to include: <ffrt/type_def.h>

Library: libffrt.z.so

System capability: SystemCapability.Resourceschedule.Ffrt.Core

Since: 10

Related module: FFRT

Summary

Structs

Name Description
struct  ffrt_function_header_t Describes a task execution function.
struct  ffrt_dependence_t Describes dependency data.
struct  ffrt_deps_t Describes dependencies.
struct  ffrt_task_attr_t Describes a task attribute.
struct  ffrt_queue_attr_t Describes a queue attribute.
struct  ffrt_condattr_t Describes a condition variable attribute.
struct  ffrt_mutexattr_t Describes a mutex attribute.
struct  ffrt_rwlockattr_t Describes a read-write lock attribute.
struct  ffrt_mutex_t Describes a mutex.
struct  ffrt_rwlock_t Describes a read-write lock.
struct  ffrt_cond_t Describes a condition variable.

Types

Name Description
typedef int ffrt_qos_t QoS type.
typedef void(* ffrt_function_t) (void *) Defines the type of the pointer to a task execution function.
typedef void * ffrt_task_handle_t Defines the handle to a task.
typedef void(* ffrt_poller_cb) (void *data, uint32_t event) The poller callback function definition.
typedef void(* ffrt_timer_cb) (void *data) The timer callback function definition.
typedef int ffrt_timer_t Handle to the timer.

Enums

Name Description
ffrt_queue_priority_t {
ffrt_queue_priority_immediate = 0,
ffrt_queue_priority_high,
ffrt_queue_priority_low, ffrt_queue_priority_idle
}
Enumerates the task priority types.
ffrt_qos_default_t {
ffrt_qos_inherit = -1,
ffrt_qos_background, ffrt_qos_utility,
ffrt_qos_default,
ffrt_qos_user_initiated
}
Enumerates the task QoS types.
ffrt_storage_size_t {
ffrt_task_attr_storage_size = 128,
ffrt_auto_managed_function_storage_size = 64 + sizeof(ffrt_function_header_t),
ffrt_mutex_storage_size = 64,
ffrt_cond_storage_size = 64,
ffrt_queue_attr_storage_size = 128
}
Enumerates the storage sizes available for different types of structs.
ffrt_function_kind_t {
ffrt_function_kind_general,
ffrt_function_kind_queue
}
Enumerates the task types.
ffrt_dependence_type_t {
ffrt_dependence_data,
ffrt_dependence_task
}
Enumerates the dependency types.
ffrt_error_t {
ffrt_error = -1,
ffrt_success = 0,
ffrt_error_nomem = ENOMEM,
ffrt_error_timedout = ETIMEDOUT,
ffrt_error_busy = EBUSY,
ffrt_error_inval = EINVAL
}
Enumerates the FFRT error codes.
ffrt_mutex_type {
ffrt_mutex_normal = 0,
ffrt_mutex_recursive = 2,
ffrt_mutex_default = ffrt_mutex_normal
}
Enumerates the mutex types.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Function Flow Runtime Kit

harmony 鸿蒙FFRT

harmony 鸿蒙condition_variable.h

harmony 鸿蒙ffrt_cond_t

harmony 鸿蒙ffrt_condattr_t

harmony 鸿蒙ffrt_dependence_t

harmony 鸿蒙ffrt_deps_t

harmony 鸿蒙ffrt_function_header_t

harmony 鸿蒙ffrt_mutex_t

harmony 鸿蒙ffrt_mutexattr_t

0  赞