summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsychocrypt <psychocryptHPC@gmail.com>2018-04-17 22:38:14 +0200
committerTimothy Pearson <tpearson@raptorengineering.com>2018-06-04 21:07:11 +0000
commit86b976dfa51a4d78669ce1f34eb5f6f4ce876ec3 (patch)
tree45bfd56fabfddd6a57c49c26ff7710fdfd12f871
parent262c0a7791c7ddbbfde89747d3a6675eac1c5a8e (diff)
downloadxmr-stak-86b976dfa51a4d78669ce1f34eb5f6f4ce876ec3.zip
xmr-stak-86b976dfa51a4d78669ce1f34eb5f6f4ce876ec3.tar.gz
fix wrong unique_lock usage
clang warns about the wrong usage: ``` ``` xmrstak/net/jpsock.cpp:232:30: warning: parentheses were disambiguated as redundant parentheses around declaration of variable named 'job_mutex' [-Wvexing-parse] std::unique_lock<std::mutex>(job_mutex); ^~~~~~~~~~~ xmrstak/net/jpsock.cpp:232:30: note: add a variable name to declare a 'std::unique_lock<std::mutex>' initialized with 'job_mutex' std::unique_lock<std::mutex>(job_mutex); ```
-rw-r--r--xmrstak/net/jpsock.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/xmrstak/net/jpsock.cpp b/xmrstak/net/jpsock.cpp
index d71aeb1..74d1c26 100644
--- a/xmrstak/net/jpsock.cpp
+++ b/xmrstak/net/jpsock.cpp
@@ -229,7 +229,7 @@ void jpsock::jpsock_thread()
else
disconnect_time = 0;
- std::unique_lock<std::mutex>(job_mutex);
+ std::unique_lock<std::mutex> lck(job_mutex);
memset(&oCurrentJob, 0, sizeof(oCurrentJob));
bRunning = false;
}
@@ -439,7 +439,7 @@ bool jpsock::process_pool_job(const opq_json_val* params)
if(motd != nullptr && motd->IsString() && (motd->GetStringLength() & 0x01) == 0)
{
- std::unique_lock<std::mutex>(motd_mutex);
+ std::unique_lock<std::mutex> lck(motd_mutex);
if(motd->GetStringLength() > 0)
{
pool_motd.resize(motd->GetStringLength()/2 + 1);
@@ -454,7 +454,7 @@ bool jpsock::process_pool_job(const opq_json_val* params)
executor::inst()->push_event(ex_event(oPoolJob, pool_id));
- std::unique_lock<std::mutex>(job_mutex);
+ std::unique_lock<std::mutex> lck(job_mutex);
oCurrentJob = oPoolJob;
return true;
}
@@ -679,13 +679,13 @@ bool jpsock::cmd_submit(const char* sJobId, uint32_t iNonce, const uint8_t* bRes
void jpsock::save_nonce(uint32_t nonce)
{
- std::unique_lock<std::mutex>(job_mutex);
+ std::unique_lock<std::mutex> lck(job_mutex);
oCurrentJob.iSavedNonce = nonce;
}
bool jpsock::get_current_job(pool_job& job)
{
- std::unique_lock<std::mutex>(job_mutex);
+ std::unique_lock<std::mutex> lck(job_mutex);
if(oCurrentJob.iWorkLen == 0)
return false;
@@ -699,7 +699,7 @@ bool jpsock::get_pool_motd(std::string& strin)
if(!ext_motd)
return false;
- std::unique_lock<std::mutex>(motd_mutex);
+ std::unique_lock<std::mutex> lck(motd_mutex);
if(pool_motd.size() > 0)
{
strin.assign(pool_motd);
OpenPOWER on IntegriCloud