diff options
Diffstat (limited to 'xmrstak/misc')
-rw-r--r-- | xmrstak/misc/configEditor.hpp | 4 | ||||
-rw-r--r-- | xmrstak/misc/executor.cpp | 10 | ||||
-rw-r--r-- | xmrstak/misc/executor.hpp | 4 | ||||
-rw-r--r-- | xmrstak/misc/thdq.hpp | 12 |
4 files changed, 15 insertions, 15 deletions
diff --git a/xmrstak/misc/configEditor.hpp b/xmrstak/misc/configEditor.hpp index 4ab2030..a840bc4 100644 --- a/xmrstak/misc/configEditor.hpp +++ b/xmrstak/misc/configEditor.hpp @@ -16,7 +16,7 @@ struct configEditor configEditor() { - + } static bool file_exist( const std::string filename) @@ -51,7 +51,7 @@ struct configEditor { m_fileContent = std::regex_replace(m_fileContent, std::regex(search), substring); } - + }; } // namepsace xmrstak diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp index 43e3d6b..dea1dab 100644 --- a/xmrstak/misc/executor.cpp +++ b/xmrstak/misc/executor.cpp @@ -267,7 +267,7 @@ void executor::log_socket_error(jpsock* pool, std::string&& sError) pool_name.reserve(128); pool_name.append("[").append(pool->get_pool_addr()).append("] "); sError.insert(0, pool_name); - + vSocketLog.emplace_back(std::move(sError)); printer::inst()->print_msg(L1, "SOCKET ERROR - %s", vSocketLog.back().msg.c_str()); @@ -321,7 +321,7 @@ jpsock* executor::pick_pool_by_id(size_t pool_id) void executor::on_sock_ready(size_t pool_id) { jpsock* pool = pick_pool_by_id(pool_id); - + if(pool->is_dev_pool()) printer::inst()->print_msg(L1, "Dev pool connected. Logging in..."); else @@ -342,7 +342,7 @@ void executor::on_sock_error(size_t pool_id, std::string&& sError, bool silent) jpsock* pool = pick_pool_by_id(pool_id); pool->disconnect(); - + if(pool_id == current_pool_id) current_pool_id = invalid_pool_id; @@ -505,7 +505,7 @@ void executor::ex_main() if(!cfg.tls) tls = false; pools.emplace_back(i+1, cfg.sPoolAddr, cfg.sWalletAddr, cfg.sPasswd, cfg.weight, false, cfg.tls, cfg.tls_fingerprint, cfg.nicehash); } - + if(jconf::inst()->IsCurrencyMonero()) { if(tls) @@ -753,7 +753,7 @@ void executor::hashrate_report(std::string& out) if((i & 0x1) == 1) //We had odd number of threads out.append("|\n"); - + if(nthd != 1) out.append("-----------------------------------------------------\n"); else diff --git a/xmrstak/misc/executor.hpp b/xmrstak/misc/executor.hpp index c90e864..c2caa39 100644 --- a/xmrstak/misc/executor.hpp +++ b/xmrstak/misc/executor.hpp @@ -53,7 +53,7 @@ private: }; inline void set_timestamp() { dev_timestamp = get_timestamp(); }; - + // In miliseconds, has to divide a second (1000ms) into an integer number constexpr static size_t iTickTime = 500; @@ -97,7 +97,7 @@ private: constexpr static size_t motd_max_length = 512; bool motd_filter_console(std::string& motd); bool motd_filter_web(std::string& motd); - + void hashrate_report(std::string& out); void result_report(std::string& out); void connection_report(std::string& out); diff --git a/xmrstak/misc/thdq.hpp b/xmrstak/misc/thdq.hpp index 248c807..7a4a5cf 100644 --- a/xmrstak/misc/thdq.hpp +++ b/xmrstak/misc/thdq.hpp @@ -1,10 +1,10 @@ #pragma once
-
+ #include <queue>
#include <thread>
#include <mutex>
#include <condition_variable>
-
+ template <typename T>
class thdq
{
@@ -17,7 +17,7 @@ public: queue_.pop();
return item;
}
-
+ void pop(T& item)
{
std::unique_lock<std::mutex> mlock(mutex_);
@@ -25,7 +25,7 @@ public: item = queue_.front();
queue_.pop();
}
-
+ void push(const T& item)
{
std::unique_lock<std::mutex> mlock(mutex_);
@@ -33,7 +33,7 @@ public: mlock.unlock();
cond_.notify_one();
}
-
+ void push(T&& item)
{
std::unique_lock<std::mutex> mlock(mutex_);
@@ -41,7 +41,7 @@ public: mlock.unlock();
cond_.notify_one();
}
-
+ private:
std::queue<T> queue_;
std::mutex mutex_;
|