Deadlock/2
Often deadlock condition arises from error processing:
- if lcka is set in the first section and the if statement branches around the unset lock, threads running the other sections will deadlock waiting forever for the lock to be released
- make sure locks are always released
call omp_unset_lock(lcka)
call omp_unset_lock(lcka)
c$omp end parallel sections