Skip to content

Use critical sections to protect FontObject#9498

Open
colesbury wants to merge 1 commit intopython-pillow:mainfrom
colesbury:ft-critical-sections
Open

Use critical sections to protect FontObject#9498
colesbury wants to merge 1 commit intopython-pillow:mainfrom
colesbury:ft-critical-sections

Conversation

@colesbury
Copy link

FreeType FT_Face objects are not thread-safe. Use per-object critical sections to protect FontObject methods that access the underlying FT_Face in the free-threaded build.

Fixes #9497.

@colesbury colesbury marked this pull request as ready for review March 25, 2026 18:53
@radarhere radarhere added the Free-threading PEP 703 support label Mar 26, 2026
FreeType FT_Face objects are not thread-safe. Use per-object critical
sections to protect FontObject methods that access the underlying FT_Face
in the free-threaded build.

Fixes python-pillow#9497
@hugovk hugovk force-pushed the ft-critical-sections branch from a912615 to e4d72b5 Compare March 26, 2026 12:42
@hugovk
Copy link
Member

hugovk commented Mar 26, 2026

(Rebased to pull in the unrelated 32-bit Windows fix)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Free-threading PEP 703 support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FreeTypeFont is not thread-safe with free threading

3 participants