mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
testing/drivers: Fix posix timer assertions.
On QEMU, if vcpus are preempted by other threads, the deviation of the timer might be very large, causing assertion failure. This commit addressed the problem. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
parent
01e5e50619
commit
ae7a0d81e9
1 changed files with 2 additions and 1 deletions
|
|
@ -161,7 +161,8 @@ static void posix_timer_callback(union sigval arg)
|
|||
|
||||
syslog(0, "range: %d ms\n", range);
|
||||
|
||||
assert(range >= sigev_para->it.it_interval.tv_sec * 1000);
|
||||
assert(range >= sigev_para->it.it_interval.tv_sec * 1000 -
|
||||
sigev_para->deviation);
|
||||
|
||||
syslog(LOG_DEBUG, "callback trigger!!!\n");
|
||||
(*sigev_para).tim = get_timestamp();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue