Deadlock/1
The following code shows a race condition with deadlock:
- if A is locked by one thread and B by another - there is a deadlock
- if the same thread gets both locks, you get a race condition:
- different behaviour depending on detailed timing of the threads
- Avoid nesting different locks
call omp_unset_lock(lckb)
call omp_unset_lock(lcka)
call omp_unset_lock(lcka)
call omp_unset_lock(lckb)
c$omp end parallel sections