Skip to content

Improving thread performance #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: Remove unused attribute
  • Loading branch information
caffeine-addictt committed Mar 8, 2024
commit 49e35581ad8b38d34a865bd8f81f70a20010467c
4 changes: 2 additions & 2 deletions src/thread/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ParallelProcessing: ...
HookFunction,
)
from typing_extensions import Generic, ParamSpec
from typing import List, Callable, Optional, Union, Mapping, Sequence, Tuple, Generator
from typing import List, Optional, Union, Mapping, Sequence, Tuple, Generator


Threads: set['Thread'] = set()
Expand All @@ -57,7 +57,6 @@ class Thread(threading.Thread, Generic[_Target_P, _Target_T]):

# threading.Thread stuff
_initialized: bool
_run: Callable

def __init__(
self,
Expand Down Expand Up @@ -272,6 +271,7 @@ def kill(self, yielding: bool = False, timeout: float = 5) -> bool:
raise exceptions.ThreadNotRunningError()

self.status = 'Kill Scheduled'

res: int = ctypes.pythonapi.PyThreadState_SetAsyncExc(
ctypes.c_long(self.ident), ctypes.py_object(SystemExit)
)
Expand Down