sleep.h
Overview
The sleep.h file declares the sleep and yield APIs in C.
File to include: <ffrt/sleep.h>
Library: libffrt.z.so
System capability: SystemCapability.Resourceschedule.Ffrt.Core
Since: 10
Related module: FFRT
Summary
Function
| Name | Description |
|---|---|
| FFRT_C_API int ffrt_usleep(uint64_t usec) | Sets the fixed sleep time. |
| FFRT_C_API void ffrt_yield(void) | Passes control to other tasks so that they can be executed. |
Function Description
ffrt_usleep()
FFRT_C_API int ffrt_usleep(uint64_t usec)
Description
Sets the fixed sleep time.
Since: 10
Parameters
| Name | Description |
|---|---|
| uint64_t usec | Sleep time, in microseconds. |
Returns
| Type | Description |
|---|---|
| FFRT_C_API int | Returns ffrt_success if the sleep time is set; returns ffrt_error otherwise. |
ffrt_yield()
FFRT_C_API void ffrt_yield(void)
Description
Passes control to other tasks so that they can be executed.
Since: 10
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-ffrt-ffrt-mutex-t
openharmony 鸿蒙 capi-ffrt-ffrt-rwlockattr-t
openharmony 鸿蒙 capi-ffrt-ffrt-rwlock-t
openharmony 鸿蒙 capi-shared-mutex-h