mirror of
https://github.com/apache/nuttx.git
synced 2026-09-02 23:23:02 +00:00
pm: shorten the pm procfs domain lock time.
snprintf and procfs_memcpy don't have to do inside lock. Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
parent
112e67f863
commit
3d1b3ba1f5
1 changed files with 2 additions and 2 deletions
|
|
@ -330,6 +330,8 @@ static ssize_t pm_read_state(FAR struct file *filep, FAR char *buffer,
|
|||
sum += wake[state] + sleep[state];
|
||||
}
|
||||
|
||||
pm_domain_unlock(pmfile->domain, flags);
|
||||
|
||||
sum = sum ? sum : 1;
|
||||
|
||||
for (state = 0; state < PM_COUNT && totalsize < buflen; state++)
|
||||
|
|
@ -355,8 +357,6 @@ static ssize_t pm_read_state(FAR struct file *filep, FAR char *buffer,
|
|||
totalsize += copysize;
|
||||
}
|
||||
|
||||
pm_domain_unlock(pmfile->domain, flags);
|
||||
|
||||
filep->f_pos += totalsize;
|
||||
return totalsize;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue