forked from arrayfire/arrayfire
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move nativeFree calls outside of the memory_mutex to avoid deadlock (a…
…rrayfire#2124) Narrows the scope of the memory_mutex locks to just around the modification and reading of the internal memory data members and elements. This means that actual allocations happen outside of this mutex's lock. This was done because the CPU backend requires that the free operation performs a sync before the pointer is freed. This caused deadlocks when the main thread was waiting on the worker thread and the worker thread called nativeFree. This scenario happens when a buffer node is only referenced in the worker thread and it is removed.
- Loading branch information
Showing
1 changed file
with
83 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters