Skip to content

Commit

Permalink
Enable multiprocessing freeze_support (for Windows) and enable forkse…
Browse files Browse the repository at this point in the history
…rver

Since we use a thread for logging among other possibilities, we were
never able to use threads safely when forking. forkserver will do the job.
  • Loading branch information
jbarlow83 committed Oct 24, 2023
1 parent 53c953a commit b9646b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ocrmypdf/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from __future__ import annotations

import logging
import multiprocessing
import os
import signal
import sys
Expand Down Expand Up @@ -76,4 +77,7 @@ def run(args=None):


if __name__ == '__main__':
multiprocessing.freeze_support()
if os.name == 'posix':
multiprocessing.set_start_method('forkserver')
sys.exit(run())

0 comments on commit b9646b6

Please sign in to comment.