Closed tommikas closed 8 years ago
@RomanSaveljev @kjbracey-arm Could you review please.
Do we need a mutex for mbed_trace_init
and then a mutex for assigning mutex functions? :) I mean all this approach seems a little bit fishy to me (probably, because I am not really in the loop)..
Currently the mutexes are only meant to protect the actual trace calls. Initialization and configuration aren't protected.
Needs to be documented carefully, because of the "creativity window" we leave open for the user.
LGTM
I'll add a little more documentation.
@SeppoTakalo Could you take a look at this please.
+1
Calling mbed_trace_init() set the callbacks to NULL so they had to be set after initializing the library. This left a small window of time during which traces could happen without any thread safety being in place.