Fixed global init/shutdown order

This commit is contained in:
SChernykh
2024-12-03 21:05:27 +01:00
parent ecdaa83669
commit fb8e2a71e0
15 changed files with 130 additions and 74 deletions

View File

@@ -15,14 +15,26 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common.h"
#include "util.h"
#include "pool_block.h"
#include "gtest/gtest.h"
void p2pool_usage() {}
namespace p2pool { void set_main_thread(); }
using namespace p2pool;
int main(int argc, char** argv)
{
p2pool::set_main_thread();
set_main_thread();
PoolBlock::s_precalculatedSharesLock = new ReadWriteLock();
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
const int result = RUN_ALL_TESTS();
delete PoolBlock::s_precalculatedSharesLock;
return result;
}