facebook / fishhook

A library that enables dynamically rebinding symbols in Mach-O binaries running on iOS.
BSD 3-Clause "New" or "Revised" License
5.17k stars 965 forks source link

How thread-safe is fishhook #76

Closed michaeleisel closed 4 years ago

michaeleisel commented 4 years ago

I want to hook pthread_create in main, but I'm curious if there can be any tearing or otherwise bugs due to thread safety. I don't mind if it's undefined whether concurrent calls use the old or the new function, I just want to be sure that there won't be any peripheral bugs.

swolchok commented 4 years ago

If you hook in main (i.e., before any other threads are created), how would there be any concurrent calls?

michaeleisel commented 4 years ago

Fair point

swolchok commented 4 years ago

Sounds like that answered your question, so closing. Thanks for asking!