Skip to content

Commit b545c60

Browse files
authored
[SYCL] Remove unnecessary mutex locks from release and retain functions (#6192)
Commit removes mutex locks from PI release and retain functions. They were added under impression that 2 threads working simultaneously on releasing resources can both reach ref count 0 and cause double free. But since our ref count is atomic and decrement is an atomic operation only single thread will execute code under if (--(PiObj->RefCount) == 0). There can't be 2 threads which can reach ref count 0. Behavior is undefined if DPCPP runtime calls somehow uses deleted pi object (with ref count 0) or provides it as an argument to any of the pi functions.
1 parent b78bf00 commit b545c60

File tree

2 files changed

+266
-289
lines changed

2 files changed

+266
-289
lines changed

0 commit comments

Comments
 (0)