From 4859b47f58206f284e2a6aef30612ad9067da3ca Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Thu, 12 Dec 2019 15:57:13 +0000 Subject: [PATCH] Updated the documentation --- .../juce_core/memory/juce_ReferenceCountedObject.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/juce_core/memory/juce_ReferenceCountedObject.h b/modules/juce_core/memory/juce_ReferenceCountedObject.h index 617d2d091d6c..575687d8c326 100644 --- a/modules/juce_core/memory/juce_ReferenceCountedObject.h +++ b/modules/juce_core/memory/juce_ReferenceCountedObject.h @@ -49,9 +49,14 @@ namespace juce Once a new ReferenceCountedObject has been assigned to a pointer, be careful not to delete the object manually. - This class uses an Atomic value to hold the reference count, so that - the pointers can be passed between threads safely. For a faster but non-thread-safe - version, use SingleThreadedReferenceCountedObject instead. + This class uses an Atomic value to hold the reference count, so + the reference count can be updated on multiple threads. Note that + whilst it's thread-safe to create and delete a ReferenceCountedObjectPtr + to a ReferenceCountedObject shared between threads, it's not thread-safe + to modify or swap the ReferenceCountedObject. + + For a faster but non-thread-safe version, use SingleThreadedReferenceCountedObject + instead. @see ReferenceCountedObjectPtr, ReferenceCountedArray, SingleThreadedReferenceCountedObject