阅读背景:

在C中覆盖_init函数,它有多安全?

来源:互联网 

I am building a debugging memory tool in a form of a shared library which I link against an executable at run time(includes overrided methods of malloc family). To handle initializations of my data structures I simple use a condition variable. Every time my malloc is called I check if the variable is not set and then I call a function responsible for initializing my structures. Now this works fine for programs running a single thread of execution but problems arise if a program includes more than 1 thread.I am building a debugging memory tool in a form




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: