Closed korjaa closed 7 years ago
ARM Internal Ref: IOTSYST-2476
I was just told I'm not using recursive mutexes when I should have :)
What I should have done:
pthread_mutexattr_t stdout_mutex_attr;
pthread_mutexattr_init(&stdout_mutex_attr);
pthread_mutexattr_settype(&stdout_mutex_attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&stdout_mutex, &stdout_mutex_attr);
What I did:
pthread_mutex_init(&stdout_mutex, NULL);
I think this recursive mutex requirement should be added to the README.md.
So it's highly likely this issue isn't real, I was just using it wrongly.
Changed from bug to enhancement, because just stating recursive mutex requirement on README.md would be enough I think.
The mbed_trace.h header mentions this here: https://github.com/ARMmbed/mbed-trace/blob/master/mbed-trace/mbed_trace.h#L254-L255
But yeah, I agree it should be mentioned in the readme too.
Documentation updated in #77.
With intensive printing I think I'm having issue with some sort of deadlock by mbed-trace.
Test to reproduce: https://github.com/ARMmbed/mbed-trace/pull/73