diff options
author | Jürg Billeter <j@bitron.ch> | 2020-09-14 12:05:12 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2020-09-14 17:39:17 +0200 |
commit | fdca4c15e314dcf75d05e652798b43948598a012 (patch) | |
tree | 0e50bf62fc62b5584defe7420493c006132e5b7e /src/buildstream/utils.py | |
parent | 9c1dcc068b49a2cabfa925c5a5f75b390883da15 (diff) | |
download | buildstream-juerg/cache-query-wip.tar.gz |
Diffstat (limited to 'src/buildstream/utils.py')
-rw-r--r-- | src/buildstream/utils.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/buildstream/utils.py b/src/buildstream/utils.py index e9f06aad6..eb4881837 100644 --- a/src/buildstream/utils.py +++ b/src/buildstream/utils.py @@ -34,6 +34,7 @@ from stat import S_ISDIR import subprocess from subprocess import TimeoutExpired import tempfile +import threading import time import datetime import itertools @@ -874,6 +875,7 @@ def _pretty_size(size, dec_places=0): # Return whether we are in the main process or not. # def _is_main_process(): + return threading.current_thread() == threading.main_thread() assert _MAIN_PID is not None return os.getpid() == _MAIN_PID |