线程只有一个内核对象和有个栈,几乎不涉及记录活动,所以不占用内存。
伪句柄:
GetCurrentProcess()
GetCurrentThread()
返回内核对象的伪句柄,不是真正的句柄,不会影响进程内核对象的使用计数。不需要closeHandle。
将伪句柄转换成真正的句柄
DuplicateHandle()
example:
duplicateHandle(
getCurrentProcess(),
GetCurrentThread(),
getCurrentProcess(),
&thread,
0,
FALSE,
DUPLICATE_SAME_ACCESS)
线程挂起:
1、在创建线程时,使用create_suspend
2、调用SuspendThread(thandle)
线程恢复:
rusumeThread()
169万+

被折叠的 条评论
为什么被折叠?



