I was intrigued by the way it detours without a trampoline, but as I discussed that with my partner he pointed out that DETOUR_ORIG_CALL isn't thread safe, given how it restores the function, runs the function, then re-hook the function.
If the library were to provide thread safety for users of the library, what would be an acceptable way to implement per detour context mutex?
pthread/mingw-w64 pthread?
pthread/CreateMutexA?
- c++
std::mutex?
- other ideas?
I was intrigued by the way it detours without a trampoline, but as I discussed that with my partner he pointed out that DETOUR_ORIG_CALL isn't thread safe, given how it restores the function, runs the function, then re-hook the function.
If the library were to provide thread safety for users of the library, what would be an acceptable way to implement per detour context mutex?
pthread/mingw-w64 pthread?pthread/CreateMutexA?std::mutex?