Soft'N'Design Software
/
projects
/
benchmarks.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da56974
)
avoid initial aberant value in semaphore test
author
Laurent MAZET
<laurent.mazet@thalesgroup.com>
Fri, 17 Oct 2025 16:04:25 +0000
(18:04 +0200)
committer
Laurent MAZET
<laurent.mazet@thalesgroup.com>
Fri, 17 Oct 2025 16:04:25 +0000
(18:04 +0200)
semaphore.c
patch
|
blob
|
blame
|
history
diff --git
a/semaphore.c
b/semaphore.c
index 223937d694b282fd0e0415232cafc5bf14b3d712..7552ee22fc5dd2bb6dc56d37f90d8e712353fc22 100644
(file)
--- a/
semaphore.c
+++ b/
semaphore.c
@@
-66,6
+66,9
@@
void *pong (__attribute__((unused)) void *arg)
sem_wait (&sem);
sys_timestamp (&ts2);
deltas[i] = diff_timestamp (&ts2, &ts1);
+ if ((i == 0) && (deltas[i] > 1e9)) {
+ i--;
+ }
pthread_mutex_lock (&mutex);
usleep (TIMER);