Windows API similar to pthread_cancel?

前端 未结 2 539
没有蜡笔的小新
没有蜡笔的小新 2021-01-13 14:54

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

2条回答
  •  天涯浪人
    2021-01-13 15:56

    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.

提交回复
热议问题