From c2fceb6e4af58d9f8ebf3d1006b889a923eacd5f Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 19 May 2020 11:33:34 +0200 Subject: [PATCH] Add a thread safety warning to write_object() --- src/common/communication.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/communication.h b/src/common/communication.h index 8cea096e..22ac3516 100644 --- a/src/common/communication.h +++ b/src/common/communication.h @@ -41,6 +41,10 @@ using InputAdapter = bitsery::InputBufferAdapter; * @param buffer The buffer to write to. This is useful for sending audio and * chunk data since that can vary in size by a lot. * + * @warning This operation is not atomic, and calling this function with the + * same socket from multiple threads at once will cause issues with the + * packets arriving out of order. + * * @relates read_object */ template