SWDEV-400644: Reset the mutex only if errors

To prevent reset the mutex while using it, only reset the mutex
if it cannot acquire it.

Change-Id: I95e0ed1bf543f285ce81b4df9c51e16a88081d38


[ROCm/amdsmi commit: 160c99d12d]
This commit is contained in:
Bill(Shuzhou) Liu
2023-05-16 13:09:13 -05:00
committed by Dmitrii Galantsev
orang tua 14b2f93d48
melakukan a4c1afe5d4
2 mengubah file dengan 16 tambahan dan 11 penghapusan
+1 -1
Melihat File
@@ -61,7 +61,7 @@ typedef struct shared_mutex_t {
// There is no workaround currently, except to run first
// initialization only before multi-threaded or multi-process
// functionality.
shared_mutex_t shared_mutex_init(const char *name, mode_t mode);
shared_mutex_t shared_mutex_init(const char *name, mode_t mode, bool retried=false);
// Close access to the shared mutex and free all the resources,
// used by the structure.