diff --git a/internal_filesystem/lib/threading.py b/internal_filesystem/lib/threading.py index 31c04ec7..dc62621e 100644 --- a/internal_filesystem/lib/threading.py +++ b/internal_filesystem/lib/threading.py @@ -1,11 +1,21 @@ -try: - import _thread -except ImportError: - _thread = None +import _thread + +class Thread: + def __init__(self, group=None, target=None, name=None, args=(), kwargs=None): + self.target = target + self.args = args + self.kwargs = {} if kwargs is None else kwargs + + def start(self): + _thread.start_new_thread(self.run, ()) + + def run(self): + self.target(*self.args, **self.kwargs) + class Lock: def __init__(self): - self._lock = _thread.allocate_lock() if _thread else None + self._lock = _thread.allocate_lock() def __enter__(self): if self._lock: