Closed jkrumbiegel closed 5 months ago
Patch coverage: 75.00
% and project coverage change: +0.11
:tada:
Comparison is base (
b7d6d65
) 94.62% compared to head (bfc60dc
) 94.73%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
FreeType has been showing up in threading issues when using Makie. When checking the FreeType docs, I found that when using a single library object, one should lock on
FT_New_Face
andFT_Done_Face
, which is implemented here. I tried to follow the best practices for locks in finalizers and took the implementation from this PR https://github.com/JuliaIO/HDF5.jl/pull/1049/files which got it from here https://docs.julialang.org/en/v1/manual/multi-threading/#Safe-use-of-FinalizersI also added an ENV variable setting the number of threads in CI tests to 4 so that the test (which is very basic and could probably be improved) should have multiple threads to run on. The test doesn't ensure that, but I didn't quickly find an easy way to do it except the unmaintained (by now probably outdated) library https://github.com/JuliaTesting/PerformanceTestTools.jl
This does not solve the problem of using FT_Face objects from multiple threads but I'll leave that for a future implementation. Probably, those objects should each get their own lock.