1.23
2.0
acw/focus-triggers
main
test-branch
| Line | |
|---|
| 1 | !!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
|
|---|
| 2 | !!! Copyright (c) 2017-20, Lawrence Livermore National Security, LLC
|
|---|
| 3 | !!! and DataRaceBench project contributors. See the DataRaceBench/COPYRIGHT file for details.
|
|---|
| 4 | !!!
|
|---|
| 5 | !!! SPDX-License-Identifier: (BSD-3-Clause)
|
|---|
| 6 | !!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
|
|---|
| 7 |
|
|---|
| 8 | !Two tasks with a lock synchronization to ensure execution order. No data race pairs.
|
|---|
| 9 |
|
|---|
| 10 | program DRB069_sectionslock1_orig_no
|
|---|
| 11 | use omp_lib
|
|---|
| 12 | implicit none
|
|---|
| 13 |
|
|---|
| 14 | integer (kind=omp_lock_kind) lock
|
|---|
| 15 | integer :: i
|
|---|
| 16 | i = 0
|
|---|
| 17 | call omp_init_lock(lock)
|
|---|
| 18 |
|
|---|
| 19 | !$omp parallel sections
|
|---|
| 20 | !$omp section
|
|---|
| 21 | call omp_set_lock(lock)
|
|---|
| 22 | i = i + 1
|
|---|
| 23 | call omp_unset_lock(lock)
|
|---|
| 24 | !$omp section
|
|---|
| 25 | call omp_set_lock(lock)
|
|---|
| 26 | i = i + 2
|
|---|
| 27 | call omp_unset_lock(lock)
|
|---|
| 28 | !$omp end parallel sections
|
|---|
| 29 |
|
|---|
| 30 | call omp_destroy_lock(lock)
|
|---|
| 31 |
|
|---|
| 32 | print 100, i
|
|---|
| 33 | 100 format ('I =',i3)
|
|---|
| 34 | end program
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.