diff --git a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp index 88e860b890..da82175184 100644 --- a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp +++ b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp @@ -577,7 +577,10 @@ int WaitForOsEvent(EventHandle event, unsigned int milli_seconds) { } int ret_code = 0; - pthread_mutex_lock(&eventDescrp->mutex); + if(milli_seconds != 0) { + pthread_mutex_lock(&eventDescrp->mutex); + } + if (!eventDescrp->state) { if (milli_seconds == 0) { ret_code = 1;