Created
May 4, 2020 21:53
-
-
Save ridiculousfish/3cff64438154a20765e527be11f7cc76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern "C" void pthread_once(int *, void()); | |
namespace std | |
{ | |
extern __thread void (*__once_call)(); | |
extern "C" void __once_proxy(); | |
}; // namespace std | |
static void noop() {} | |
using voidfunc = void (*)(); | |
static voidfunc *vp; | |
static void call_vp() | |
{ | |
(*vp)(); | |
} | |
int main() | |
{ | |
using namespace std; | |
voidfunc vf = noop; | |
vp = &vf; | |
__once_call = call_vp; | |
int once{0}; | |
pthread_once(&once, __once_proxy); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment