From b47cb646ff2a62fcd3fac0e453a7261bbaefbcb7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 14 Mar 2016 13:41:38 +0200 Subject: loplugin:constantparam Change-Id: I270e068b3c83e966e741b0a072fecce9d92d53f5 --- sal/qa/osl/process/osl_Thread.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sal') diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx index 28080b41b52f..653f14486e47 100644 --- a/sal/qa/osl/process/osl_Thread.cxx +++ b/sal/qa/osl/process/osl_Thread.cxx @@ -167,11 +167,11 @@ public: osl::MutexGuard g(m_aMutex); return m_nFlag; } - void addValue(T n) + void incValue() { //only one thread operate on the flag. osl::MutexGuard g(m_aMutex); - m_nFlag += n; + m_nFlag++; } void acquire() {m_aMutex.acquire();} void release() {m_aMutex.release();} @@ -239,7 +239,7 @@ protected: { while(schedule()) { - m_aFlag.addValue(1); + m_aFlag.incValue(); ThreadHelper::thread_sleep_tenth_sec(1); } } @@ -298,7 +298,7 @@ protected: /// if the thread should terminate, schedule return false while (m_aFlag.getValue() < 20 && schedule()) { - m_aFlag.addValue(1); + m_aFlag.incValue(); ThreadHelper::thread_sleep_tenth_sec(1); if (m_nWaitSec != 0) @@ -346,7 +346,7 @@ protected: { while (m_aFlag.getValue() < 10) { - m_aFlag.addValue(1); + m_aFlag.incValue(); ThreadHelper::thread_sleep_tenth_sec(1); } } @@ -391,7 +391,7 @@ protected: //if the thread should terminate, schedule return false while (schedule()) { - m_aFlag.addValue(1); + m_aFlag.incValue(); } } void SAL_CALL onTerminated() override -- cgit