This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Ensure thread safety in ARM C/C++ libraries

Dear forum,
right now I am struggling with enabling thread safety for my ARM C/C++ libraries.

Here's the problem I am facing:
Actually I am running a multithreaded application on my Cortex-M3 device.
I am facing spontaneous crashes and suspect the source of these crashes rooted inside the C or C++ library.

As a solution I am trying to make the libraries thread safe as described here:
[1]
http://www.keil.com/support/man/docs/armlib/armlib_Chdcgdbh.htm
and here:
[2]
http://www.keil.com/support/man/docs/armlib/armlib_Chdfjddj.htm

Actually I tried to implement [2] by writing
extern "C" int _mutex_initialize(int* p_pMutex)
{ return 1;
}

inside my main.cpp file.
The problem is that _mutex_initialize is never called. Is there a special switch or anything that I have turn to force the C library calling my _mutex_initialize function?

Many thanks in advance and best regards
Jan