Resolved conflicts
This commit is contained in:
commit
d03fb91b0a
82 changed files with 3489 additions and 439 deletions
39
src/App.cpp
39
src/App.cpp
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
|
@ -42,18 +42,9 @@
|
|||
#include "version.h"
|
||||
|
||||
|
||||
xmrig::App::App(Process *process) :
|
||||
m_console(nullptr),
|
||||
m_signals(nullptr)
|
||||
xmrig::App::App(Process *process)
|
||||
{
|
||||
m_controller = new Controller(process);
|
||||
if (m_controller->init() != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_controller->config()->isBackground()) {
|
||||
m_console = new Console(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,12 +59,26 @@ xmrig::App::~App()
|
|||
int xmrig::App::exec()
|
||||
{
|
||||
if (!m_controller->isReady()) {
|
||||
LOG_EMERG("no valid configuration found.");
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
m_signals = new Signals(this);
|
||||
|
||||
background();
|
||||
int rc = 0;
|
||||
if (background(rc)) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = m_controller->init();
|
||||
if (rc != 0) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (!m_controller->isBackground()) {
|
||||
m_console = new Console(this);
|
||||
}
|
||||
|
||||
VirtualMemory::init(m_controller->config()->cpu().isHugePages());
|
||||
|
||||
|
@ -94,10 +99,10 @@ int xmrig::App::exec()
|
|||
m_controller->start();
|
||||
}
|
||||
|
||||
const int r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
|
||||
rc = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
|
||||
uv_loop_close(uv_default_loop());
|
||||
|
||||
return r;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -157,7 +162,11 @@ void xmrig::App::onSignal(int signum)
|
|||
void xmrig::App::close()
|
||||
{
|
||||
m_signals->stop();
|
||||
m_console->stop();
|
||||
|
||||
if (m_console) {
|
||||
m_console->stop();
|
||||
}
|
||||
|
||||
m_controller->stop();
|
||||
|
||||
Log::destroy();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue