robust-services-core icon indicating copy to clipboard operation
robust-services-core copied to clipboard

Change instruction pointer to kill thread

Open GregUtas opened this issue 8 years ago • 0 comments

A thread is currently killed via Thread::FunctionInvoked, which is called by Debug::ft. A thread must therefore invoke a traced function to get killed. A more robust way to kill a thread is to change its instruction pointer so that it resumes execution in a function that throws an exception. However, implementing this is platform-specific. On Windows, for example, it probably means using CONTEXT, GetThreadContext, and SetThreadContext.

GregUtas avatar Nov 04 '17 19:11 GregUtas