Skip to content

Commit

Permalink
[L0] Changed atomic value comparison
Browse files Browse the repository at this point in the history
Signed-off-by: Winston Zhang <[email protected]>
  • Loading branch information
winstonzhang-intel committed Jun 17, 2024
1 parent a5995f7 commit c63a309
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions source/adapters/level_zero/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventRetain(
UR_APIEXPORT ur_result_t UR_APICALL urEventRelease(
ur_event_handle_t Event ///< [in] handle of the event object
) {
Event->RefCountExternal--;
if (Event->CounterBasedEventsEnabled && Event->RefCountExternal == 0) {
if (Event->CounterBasedEventsEnabled && --Event->RefCountExternal == 0) {
Event->Context->addEventToContextCache(Event);
} else {
UR_CALL(urEventReleaseInternal(Event));
Expand Down

0 comments on commit c63a309

Please sign in to comment.