SWDEV-292820 - Add a new notify lock

HSA signal calback may occur during the actual marker submit. That
may cause a deadlock, because shared lock_ object. Create the new
notify_lock_ field to protect the notification.

Change-Id: I9752af84e59895530620fac3932c6fc276de8658


[ROCm/clr commit: f34c1b9ff8]
Tá an tiomantas seo le fáil i:
German Andryeyev
2021-07-09 18:19:44 -04:00
tiomanta ag Maneesh Gupta
tuismitheoir c047842635
tiomantas 0104c5817c
D'athraigh 2 comhad le 2 breiseanna agus 1 scriosta
+1 -1
Féach ar an gComhad
@@ -265,7 +265,7 @@ bool Event::awaitCompletion() {
bool Event::notifyCmdQueue() {
HostQueue* queue = command().queue();
if (AMD_DIRECT_DISPATCH) {
ScopedLock l(lock_);
ScopedLock l(notify_lock_);
if ((status() > CL_COMPLETE) && (nullptr != queue) &&
// If HW event was assigned, then notification can be ignored, since a barrier was issued
(HwEvent() == nullptr) &&
+1
Féach ar an gComhad
@@ -89,6 +89,7 @@ class Event : public RuntimeObject {
private:
Monitor lock_;
Monitor notify_lock_; //!< Lock used for notification with direct dispatch only
std::atomic<CallBackEntry*> callbacks_; //!< linked list of callback entries.
std::atomic<int32_t> status_; //!< current execution status.