Page 1 of 1

Is CefRefPtr / scoped_refptr<T> thread safe?

PostPosted: Mon Jul 12, 2021 4:58 am
by sketch34
I want to know if scoped_refptr<T> is itself thread safe, or do I need to synchronize access to variables of this type.

Note: I don't mean T, I mean the pointer object itself.

Re: Is CefRefPtr / scoped_refptr<T> thread safe?

PostPosted: Mon Jul 12, 2021 9:55 am
by magreenblatt
Refcounting and assignment is thread-safe if you use the IMPLEMENT_RFCOUNTING macro or RefCountedThreadSafe base class. Anything that you do with T from multiple threads will need to be protected by a lock or similar.

Re: Is CefRefPtr / scoped_refptr<T> thread safe?

PostPosted: Mon Jul 19, 2021 3:38 am
by sketch34
Thank you.