Skip to content
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

Add ReentrantLocks to library and to each FTFont #87

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

jkrumbiegel
Copy link
Collaborator

When people try rendering figures on multiple threads with CairoMakie, I usually see segfaults in FreeType. So this PR adds locks for each FTFont object and for the library, as FreeType is not thread-safe. Makie caches font objects, so multiple figures are bound to use the same font handles. The test I added segfaulted without the locks.

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.38%. Comparing base (d66f2aa) to head (f4632ac).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   95.26%   95.38%   +0.11%     
==========================================
  Files           6        6              
  Lines         317      325       +8     
==========================================
+ Hits          302      310       +8     
  Misses         15       15              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jkrumbiegel jkrumbiegel requested a review from SimonDanisch April 4, 2024 19:19
@jkrumbiegel jkrumbiegel merged commit b874a85 into master Apr 5, 2024
14 checks passed
@jkrumbiegel jkrumbiegel deleted the jk/improve-thread-safety branch April 5, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants