3. [pywin32] SuspendThread 함수
pywin32/win32process2020. 10. 27. 00:26
int = SuspendThread(handle)
쓰레드를 정지시키는 함수입니다.
인자로는 handle : PyHANDLE 이 있습니다.
handle는 정지시킬 쓰레드 핸들입니다.
리턴 값은 int 로 해당 쓰레드의 이전까지의 정지 카운트입니다.
import win32process
import win32api
res1 = None
res2 = None
def cnt1():
global res1
i = win32process.SuspendThread(res1[0])
print(f"cnt1 : {i}\n")
def cnt2(value):
print(f"cnt2 : {value}\n")
win32api.Sleep(3000)
win32process.ResumeThread(res1[0])
q = tuple()
p = (3,)
res1 = win32process.beginthreadex(None, 0, cnt1, q, 0)
res2 = win32process.beginthreadex(None, 0, cnt2, p, 0)
cnt2 쓰레드가 먼저 실행되고 3초 후 cnt1 쓰레드가 실행됩니다.
결과입니다.~
반응형
'pywin32 > win32process' 카테고리의 다른 글
6. [pywin32] SetThreadPriority & Boost 함수 (0) | 2020.12.22 |
---|---|
5. [pywin32] GetThread... 관련 함수 (0) | 2020.12.21 |
4. [pywin32] ResumeThread 함수 (0) | 2020.10.27 |
2. [pywin32] beginthreadex 함수 (0) | 2020.10.27 |
1. [pywin32] win32process 소개 (0) | 2020.08.31 |
댓글()