Is there a Windows native API analogous to pthread_cancel, pthread_testcancel etc?
If not, how can we simulate cancelling of one thread from another using the pthrea
The Pthreads/win32 FAQ talks about this under question 9, "Cancelation doesn't work for me, why?". The FAQ mentions the Pthreads library using a packages called "QueueUserAPCEx" in order to achieve true asynchronous user-mode notifications. It isn't clear from your question if you are using Pthreads/win32, but you may find some hints and implementation details in the Pthreads/win32 source code.