diff --git a/test/transcoding/bookstore-server.cc b/test/transcoding/bookstore-server.cc index 5abc026a1..216004d18 100644 --- a/test/transcoding/bookstore-server.cc +++ b/test/transcoding/bookstore-server.cc @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -47,6 +48,8 @@ void PrintRequest(const MessageType& message) { static ::google::protobuf::util::TypeResolver* type_resolver = ::google::protobuf::util::NewTypeResolverForDescriptorPool( "type.googleapis.com", message.GetDescriptor()->file()->pool()); + static std::mutex mutex; + std::lock_guard lock(mutex); std::string binary; if (!message.SerializeToString(&binary)) {