• Alexander Alekhin's avatar
    core(ocl): fix deadlock in UMatDataAutoLock · cec70052
    Alexander Alekhin authored
    UMatData locks are not mapped on real locks (they are mapped to some "pre-initialized" pool).
    
    Concurrent execution of these statements may lead to deadlock:
    - a.copyTo(b) from thread 1
    - c.copyTo(d) from thread 2
    where:
    - 'a' and 'd' are mapped to single lock "A".
    - 'b' and 'c' are mapped to single lock "B".
    
    Workaround is to process locks with strict order.
    cec70052
umatrix.hpp 520 Bytes