|
14 | 14 | #include <libstuff/libstuff.h>
|
15 | 15 | #include <libstuff/SRandom.h>
|
16 | 16 | #include <libstuff/AutoTimer.h>
|
17 |
| -#include <libstuff/ResourceMonitorThread.h> |
18 | 17 | #include <PageLockGuard.h>
|
19 | 18 | #include <sqlitecluster/SQLitePeer.h>
|
20 | 19 |
|
@@ -118,9 +117,9 @@ void BedrockServer::sync()
|
118 | 117 | // our worker threads now. We don't wait until the node is `LEADING` or `FOLLOWING`, as it's state can change while
|
119 | 118 | // it's running, and our workers will have to maintain awareness of that state anyway.
|
120 | 119 | SINFO("Starting " << workerThreads << " worker threads.");
|
121 |
| - list<ResourceMonitorThread> workerThreadList; |
| 120 | + list<thread> workerThreadList; |
122 | 121 | for (int threadId = 0; threadId < workerThreads; threadId++) {
|
123 |
| - workerThreadList.emplace_back([this, threadId](){this->worker(threadId);}); |
| 122 | + workerThreadList.emplace_back(&BedrockServer::worker, this, threadId); |
124 | 123 | }
|
125 | 124 |
|
126 | 125 | // Now we jump into our main command processing loop.
|
@@ -1339,7 +1338,7 @@ BedrockServer::BedrockServer(const SData& args_)
|
1339 | 1338 |
|
1340 | 1339 | // Start the sync thread, which will start the worker threads.
|
1341 | 1340 | SINFO("Launching sync thread '" << _syncThreadName << "'");
|
1342 |
| - _syncThread = ResourceMonitorThread(&BedrockServer::syncWrapper, this); |
| 1341 | + _syncThread = thread(&BedrockServer::syncWrapper, this); |
1343 | 1342 | }
|
1344 | 1343 |
|
1345 | 1344 | BedrockServer::~BedrockServer() {
|
@@ -1909,7 +1908,7 @@ void BedrockServer::_control(unique_ptr<BedrockCommand>& command) {
|
1909 | 1908 | if (__quiesceThread) {
|
1910 | 1909 | response.methodLine = "400 Already Blocked";
|
1911 | 1910 | } else {
|
1912 |
| - __quiesceThread = new ResourceMonitorThread([&]() { |
| 1911 | + __quiesceThread = new thread([&]() { |
1913 | 1912 | shared_ptr<SQLitePool> dbPoolCopy = _dbPool;
|
1914 | 1913 | if (dbPoolCopy) {
|
1915 | 1914 | SQLiteScopedHandle dbScope(*_dbPool, _dbPool->getIndex());
|
@@ -2139,7 +2138,7 @@ void BedrockServer::_acceptSockets() {
|
2139 | 2138 | bool threadStarted = false;
|
2140 | 2139 | while (!threadStarted) {
|
2141 | 2140 | try {
|
2142 |
| - t = ResourceMonitorThread(&BedrockServer::handleSocket, this, move(socket), port == _controlPort, port == _commandPortPublic, port == _commandPortPrivate); |
| 2141 | + t = thread(&BedrockServer::handleSocket, this, move(socket), port == _controlPort, port == _commandPortPublic, port == _commandPortPrivate); |
2143 | 2142 | threadStarted = true;
|
2144 | 2143 | } catch (const system_error& e) {
|
2145 | 2144 | // We don't care about this lock here from a performance perspective, it only happens when we
|
|
0 commit comments