rocr: Fix Potential Deadlock
Moved the Call to pthread_mutex_lock to an else statement for better code readibility. Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>
Αυτή η υποβολή περιλαμβάνεται σε:
1 γονέας
a97b7df4b9
υποβολή
1635746a9c
1 file changed
+2
-3
@@ -574,12 +574,11 @@ int WaitForOsEvent(EventHandle event, unsigned int milli_seconds) {
|
||||
// Timeout
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
pthread_mutex_lock(&eventDescrp->mutex);
|
||||
}
|
||||
|
||||
int ret_code = 0;
|
||||
if(milli_seconds != 0) {
|
||||
pthread_mutex_lock(&eventDescrp->mutex);
|
||||
}
|
||||
|
||||
if (!eventDescrp->state) {
|
||||
if (milli_seconds == 0) {
|
||||
|
||||
Reference in new issue
Block a user