JuliaGraphics / FreeTypeAbstraction.jl

A Julian abstraction layer over FreeType.jl
Other
25 stars 20 forks source link

Add `ReentrantLock`s to library and to each `FTFont` #87

Closed jkrumbiegel closed 5 months ago

jkrumbiegel commented 5 months ago

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.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.