11 type(lock_type
), allocatable
:: lock1
[:]
12 type(lock_type
), allocatable
:: lock2(:,:)[:]
13 type(lock_type
) :: lock3(4)[*]
18 allocate(lock2(2,2)[*])
34 LOCK(lock1
, stat
=stat
)
35 if (stat
/= 0) call abort()
37 LOCK(lock2(1,1), stat
=stat
)
38 if (stat
/= 0) call abort()
39 LOCK(lock2(2,2), stat
=stat
)
40 if (stat
/= 0) call abort()
42 LOCK(lock3(3), stat
=stat
)
43 if (stat
/= 0) call abort()
44 LOCK(lock3(4), stat
=stat
)
45 if (stat
/= 0) call abort()
48 UNLOCK(lock1
, stat
=stat
)
49 if (stat
/= 0) call abort()
51 UNLOCK(lock2(1,1), stat
=stat
)
52 if (stat
/= 0) call abort()
53 UNLOCK(lock2(2,2), stat
=stat
)
54 if (stat
/= 0) call abort()
56 UNLOCK(lock3(3), stat
=stat
)
57 if (stat
/= 0) call abort()
58 UNLOCK(lock3(4), stat
=stat
)
59 if (stat
/= 0) call abort()
61 if (this_image() == 1) then
63 LOCK (lock1
[this_image()], acquired_lock
=acquired
)
64 if (.not
. acquired
) call abort()
67 LOCK (lock2(1,1)[this_image()], acquired_lock
=acquired
)
68 if (.not
. acquired
) call abort()
71 LOCK (lock2(2,2)[this_image()], acquired_lock
=acquired
)
72 if (.not
. acquired
) call abort()
75 LOCK (lock3(3)[this_image()], acquired_lock
=acquired
)
76 if (.not
. acquired
) call abort()
79 LOCK (lock3(4)[this_image()], acquired_lock
=acquired
)
80 if (.not
. acquired
) call abort()
83 UNLOCK (lock2(1,1)[1])
84 UNLOCK (lock2(2,2)[1])