some linux mutex tweaks

This commit is contained in:
Robin Müller 2020-05-27 11:41:36 +02:00
parent be4ac0bc8f
commit f6ae0348cb
2 changed files with 7 additions and 1 deletions

View File

@ -25,7 +25,9 @@ Mutex::Mutex() {
sif::error << "Mutex: creation with name, id " << mutex.__data.__count sif::error << "Mutex: creation with name, id " << mutex.__data.__count
<< ", " << " failed with " << strerror(status) << std::endl; << ", " << " failed with " << strerror(status) << std::endl;
} }
//After a mutex attributes object has been used to initialize one or more mutexes, any function affecting the attributes object (including destruction) shall not affect any previously initialized mutexes. // After a mutex attributes object has been used to initialize one or more
// mutexes, any function affecting the attributes object
// (including destruction) shall not affect any previously initialized mutexes.
status = pthread_mutexattr_destroy(&mutexAttr); status = pthread_mutexattr_destroy(&mutexAttr);
if (status != 0) { if (status != 0) {
sif::error << "Mutex: Attribute destroy failed with " << strerror(status) << std::endl; sif::error << "Mutex: Attribute destroy failed with " << strerror(status) << std::endl;

View File

@ -2,7 +2,11 @@
#define OS_RTEMS_MUTEX_H_ #define OS_RTEMS_MUTEX_H_
#include <framework/ipc/MutexIF.h> #include <framework/ipc/MutexIF.h>
extern "C" {
#include <pthread.h> #include <pthread.h>
}
class Mutex : public MutexIF { class Mutex : public MutexIF {
public: public: