Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/Components > API/Runtime/Engine/Components/UPrimitiveComponent
Syntax
FThreadSafeCounter AttachmentCounter
Remarks
Incremented by the main thread before being attached to the scene, decremented by the rendering thread after removal. This counter exists to assert that operations are safe in order to help avoid race conditions. *** Runtime logic should NEVER rely on this value. ***
The only safe assertions to make are: AttachmentCounter == 0: The primitive is not exposed to the rendering thread, it is safe to modify shared members. This assertion is valid ONLY from the main thread.
AttachmentCounter >= 1: The primitive IS exposed to the rendering thread and therefore shared members must not be modified. This assertion may be made from any thread. Note that it is valid and expected for AttachmentCounter to be larger than 1, e.g. during reattachment.