Is CefRefPtr / scoped_refptr<T> thread safe?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Is CefRefPtr / scoped_refptr<T> thread safe?

Postby sketch34 » Mon Jul 12, 2021 4:58 am

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.
sketch34
Techie
 
Posts: 11
Joined: Sun Apr 25, 2021 8:24 pm

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

Postby magreenblatt » Mon Jul 12, 2021 9:55 am

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.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

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

Postby sketch34 » Mon Jul 19, 2021 3:38 am

Thank you.
sketch34
Techie
 
Posts: 11
Joined: Sun Apr 25, 2021 8:24 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 49 guests