MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / CurrentThread

Class CurrentThread

windows/winobject/process.py:560–592  ·  view source on GitHub ↗

The current thread

Source from the content-addressed store, hash-verified

558
559
560class CurrentThread(Thread):
561 """The current thread"""
562 @property #It's not a fixedpropety because executing thread might change
563 def tid(self):
564 """Thread ID
565
566 :type: :class:`int`
567 """
568 return winproxy.GetCurrentThreadId()
569
570 @property
571 def owner(self):
572 """The current process
573
574 :type: :class:`CurrentProcess`
575 """
576 return windows.current_process
577
578 def _get_handle(self):
579 return winproxy.GetCurrentThread()
580
581 def __del__(self):
582 pass
583
584 def exit(self, code=0):
585 """Exit the thread"""
586 return winproxy.ExitThread(code)
587
588
589
590 def wait(self, timeout=INFINITE):
591 """Raise :class:`ValueError` to prevent deadlock :D"""
592 raise ValueError("wait() on current thread")
593
594
595class CurrentProcess(Process):

Callers 1

__init__.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected