upd: restructrued to avoid useless concurrency and simplify the code

This commit is contained in:
2023-12-12 15:05:42 +00:00
parent 730310ea44
commit 8232adb170
8 changed files with 45 additions and 205 deletions

View File

@ -45,7 +45,8 @@ void ReadWriteLock::endWrite() {
}
namespace BookStore_ZYM {
std::mutex debug_Print_Mutex;
}
bool shut_down = false;
} // namespace BookStore_ZYM
void debugPrint() {
BookStore_ZYM::debug_Print_Mutex.lock();
std::cerr << std::endl;
@ -66,7 +67,7 @@ void BlockingStringStream::unreadlock() {
void Respond(BlockingStringStream *output_ptr, std::string SessionToken,
std::string OperationToken, std::string AuthenticationKey,
const std::vector<std::string> & ret) {
const std::vector<std::string> &ret) {
static std::mutex output_mutex;
output_mutex.lock();
(*output_ptr).readlock();