summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-12-02 07:40:43 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-12-02 10:41:24 +0300
commit9d1e3cc65d25c7ba725e11ca82dab1a476607bea (patch)
tree3d99a2a50f8cd885ebebe26a28c22110724ba2c0 /pthread_stop_world.c
parent546d896f6b3fbf04ac7de4333051b4930531dcb2 (diff)
downloadbdwgc-9d1e3cc65d25c7ba725e11ca82dab1a476607bea.tar.gz
Reduce local variable scope in resend_lost_signals_retry for cppcheck
(fix of commit ce05033c1) * pthread_stop_world.c [!NACL && HAVE_CLOCK_GETTIME && !DONT_TIMEDWAIT_ACK_SEM] (resend_lost_signals_retry): Move i local variable to inner block.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 5cbb6aea..9e98b6ed 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -502,10 +502,11 @@ static void resend_lost_signals_retry(int n_live_threads,
{
# if defined(HAVE_CLOCK_GETTIME) && !defined(DONT_TIMEDWAIT_ACK_SEM)
# define TIMEOUT_BEFORE_RESEND 10000 /* us */
- int i;
struct timespec ts;
if (n_live_threads > 0 && clock_gettime(CLOCK_REALTIME, &ts) == 0) {
+ int i;
+
TS_NSEC_ADD(ts, TIMEOUT_BEFORE_RESEND * 1000);
/* First, try to wait for the semaphore with some timeout. */
/* On failure, fallback to WAIT_UNIT pause and resend of the signal. */