From 3f59de5e733220c06008e11982196d01202dee62 Mon Sep 17 00:00:00 2001 From: acetoneRu Date: Thu, 3 Jun 2021 01:33:13 -0400 Subject: [PATCH] vanitygen output formatted with mutex --- vanitygen.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vanitygen.cpp b/vanitygen.cpp index 982d09d..883284e 100644 --- a/vanitygen.cpp +++ b/vanitygen.cpp @@ -1,6 +1,7 @@ #include "vanity.hpp" -#include -#include +#include +#include +#include static struct @@ -124,6 +125,7 @@ static inline bool NotThat(const char * a, const char *b) return false; } +std::mutex mtx; static inline bool thread_find(uint8_t * buf, const char * prefix, int id_thread, unsigned long long throughput) { /** @@ -131,7 +133,9 @@ static inline bool thread_find(uint8_t * buf, const char * prefix, int id_thread * For idea and example ^-^ * Orignal is sensei of crypto ;) */ + mtx.lock(); std::cout << "Thread " << id_thread << " binded" << std::endl; + mtx.unlock(); /* union {