-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TextServer] Improve text server interlocking. #88241
base: master
Are you sure you want to change the base?
Conversation
It's probably worth moving this part to the subclass of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same on the advanced side
@@ -463,16 +464,33 @@ class TextServerFallback : public TextServerExtension { | |||
mutable RID_PtrOwner<FontFallbackLinkedVariation> font_var_owner; | |||
mutable RID_PtrOwner<FontFallback> font_owner; | |||
mutable RID_PtrOwner<ShapedTextDataFallback> shaped_owner; | |||
mutable Mutex rid_lock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mutable Mutex rid_lock; | |
mutable Mutex rid_mutex; |
Descriptive name IMO
rid_lock.lock(); | ||
Ref<ShapedTextDataFallback> ret = Ref<ShapedTextDataFallback>(shaped_owner.get_or_null(p_rid)); | ||
rid_lock.unlock(); | ||
return ret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use MutexLock
for all these, simpler and safer
Fixes #87990, supersede #72646
free
is called for other thread)._THREAD_SAFE_CLASS_
mutex), only lock RID operation (creation, deletion, and reference acquisition).