diff --git a/src/core/ddsi/src/q_transmit.c b/src/core/ddsi/src/q_transmit.c index 4d81d84..1cbad3c 100644 --- a/src/core/ddsi/src/q_transmit.c +++ b/src/core/ddsi/src/q_transmit.c @@ -950,7 +950,7 @@ static os_result throttle_writer (struct nn_xpack *xp, struct writer *wr) nn_mtime_t tnow = now_mt (); const nn_mtime_t abstimeout = add_duration_to_mtime (tnow, nn_from_ddsi_duration (wr->xqos->reliability.max_blocking_time)); struct whc_state whcst; - whc_get_state(wr->whc, &whcst); + whc_get_state (wr->whc, &whcst); { ASSERT_MUTEX_HELD (&wr->e.lock); @@ -960,7 +960,7 @@ static os_result throttle_writer (struct nn_xpack *xp, struct writer *wr) } DDS_LOG(DDS_LC_THROTTLE, "writer %x:%x:%x:%x waiting for whc to shrink below low-water mark (whc %"PRIuSIZE" low=%u high=%u)\n", PGUID (wr->e.guid), whcst.unacked_bytes, wr->whc_low, wr->whc_high); - wr->throttling = 1; + wr->throttling++; wr->throttle_count++; /* Force any outstanding packet out: there will be a heartbeat @@ -976,6 +976,7 @@ static os_result throttle_writer (struct nn_xpack *xp, struct writer *wr) } nn_xpack_send (xp, true); os_mutexLock (&wr->e.lock); + whc_get_state (wr->whc, &whcst); } while (gv.rtps_keepgoing && !writer_may_continue (wr, &whcst)) @@ -1000,7 +1001,7 @@ static os_result throttle_writer (struct nn_xpack *xp, struct writer *wr) } } - wr->throttling = 0; + wr->throttling--; if (wr->state != WRST_OPERATIONAL) { /* gc_delete_writer may be waiting */ diff --git a/src/os/src/windows/os_platform_sync.c b/src/os/src/windows/os_platform_sync.c index 5084b13..1c36511 100644 --- a/src/os/src/windows/os_platform_sync.c +++ b/src/os/src/windows/os_platform_sync.c @@ -97,7 +97,7 @@ os_result os_condTimedWait(os_cond *cond, os_mutex *mutex, const os_time *time) assert(cond != NULL); assert(mutex != NULL); - timems = time->tv_sec * 1000 + (time->tv_nsec + 999999999) / 1000000; + timems = time->tv_sec * 1000 + (time->tv_nsec + 999999) / 1000000; if (SleepConditionVariableSRW(&cond->cond, &mutex->lock, timems, 0)) { return os_resultSuccess; } else if (GetLastError() != ERROR_TIMEOUT) {