The lite power manager provides the following capabilities:
Figure 1 Lite power manager architecture
base/powermgr/powermgr_lite
├── figures # Architecture figures
├── frameworks # Frameworks
│ ├── include # Header files
│ └── src # Source files
├── interfaces # APIs
│ ├── innerkits # Internal APIs
│ └── kits # External APIs
├── services # Services
│ ├── include # Header files
│ └── src # Source files
└── utils # Utilities
├── include # Header files
└── src # Source files
The following table lists the JavaScript APIs provided by the lite power manager.
RunningLock *CreateRunningLock(const char *name, RunningLockType type, RunningLockFlag flag) |
|
Runninglock Management
The lite power manager provides APIs to create, obtain, and release Runninglock objects.
The sample code is as follows:
const RunningLock *lock = CreateRunningLock("runinglock_example", RUNNINGLOCK_BACKGROUND, RUNNINGLOCK_FLAG_NONE);
if (lock == NULL) {
return;
}
BOOL ret = AcquireRunningLock(lock);
if (ret == FLASE) {
DestroyRunningLock(lock);
return;
}
ReleaseRunningLock(lock);
DestroyRunningLock(lock); // Must release runninglock before destroyed
Sign in to post a comment
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
Activity
Community
Health
Trend
Influence
:Code submit frequency
:React/respond to issue & PR etc.
:Well-balanced team members and collaboration
:Recent popularity of project
:Star counts, download counts etc.
Repository Comments ( 0 )