]> git.sesse.net Git - stockfish/blobdiff - src/misc.h
Introduce serialization of accesses to std::cout
[stockfish] / src / misc.h
index 57e86553ffa0b1686ab7c06d8e36a6ba8d75da60..24d41d1a0e7a5e2ada7d6c5da492e10ff68d86b9 100644 (file)
@@ -65,4 +65,11 @@ private:
   std::vector<Entry> e;
 };
 
   std::vector<Entry> e;
 };
 
+
+enum SyncCout { io_lock, io_unlock };
+std::ostream& operator<<(std::ostream&, SyncCout);
+
+#define sync_cout std::cout << io_lock
+#define sync_endl std::endl << io_unlock
+
 #endif // !defined(MISC_H_INCLUDED)
 #endif // !defined(MISC_H_INCLUDED)