Shared mutex fixes and improvements

* Don't make different shared memory mutexes for different users
* Don't delete (unlink) the shared mutex file if the mutex
  initialization fails. This may mess up other processes that
  are using it. Instead, print a message on how to resolve the
  situation, and then throw an error.

  Note, this situation comes up when debug builds (usually)
  either assert() or otherwise end execution without a proper
  clean up.
* Remove cpplint from shared_mutex code

Change-Id: I5f8ca6150cac5c2405fb97007516da345093f966
This commit is contained in:
Chris Freehill
2020-04-06 17:08:33 -05:00
rodzic fd79e5c161
commit 52196caaee
5 zmienionych plików z 41 dodań i 40 usunięć
+3
Wyświetl plik
@@ -118,6 +118,9 @@ typedef enum {
//!< input
RSMI_STATUS_UNEXPECTED_DATA, //!< The data read or provided to
//!< function is not what was expected
RSMI_STATUS_RESOURCE_BUSY, //!< A function timed out trying to
//!< a resource. This could be a
//!< mutex time-out.
RSMI_STATUS_UNKNOWN_ERROR = 0xFFFFFFFF, //!< An unknown error occurred
} rsmi_status_t;
+1 -3
Wyświetl plik
@@ -58,9 +58,7 @@
#include "rocm_smi/rocm_smi_common.h"
#include "rocm_smi/rocm_smi.h"
#include "rocm_smi/rocm_smi_counters.h"
extern "C" {
#include "shared_mutex.h" // NOLINT
};
#include "shared_mutex.h" //NOLINT
namespace amd {
namespace smi {