Clicky

Fortran Wiki
event_query (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #1 to #2: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

event_query assignes the number of events to count which have been posted to the event variable and not yet been removed by calling event wait. When stat is present and the(削除) invokation (削除ここまで)(追記) invocation (追記ここまで) was successful, it is assigned the value 0. If it is present and the(削除) invokation (削除ここまで)(追記) invocation (追記ここまで) has failed, it is assigned a positive value andcount is assigned the value 1-1.

Standard

TS 18508 or later

Class

Subroutine

Syntax

call event_query(event, count [, stat])

Arguments

  • event - (intent(in)) Scalar of type event_type, defined in iso_fortran_env; shall not be coindexed.
  • count - (intent(out))Scalar integer with at least the precision of default integer.
  • stat - (optional) Scalar default-kind integer variable.

Example

program atomic
 use iso_fortran_env
 implicit none
 type(event_type) :: event_value_has_been_set[*]
 integer :: cnt
 if (this_image() == 1) then
 call event_query(event_value_has_been_set, cnt)
 if (cnt > 0) write(*,*) "Value has been set"
 elseif (this_image() == 2) then
 event post(event_value_has_been_set[1])
 end if
end program atomic

category: intrinsics

Revised on February 23, 2017 14:27:25 by Jason Blevins (128.146.137.52) (1312 characters / 0.0 pages)
Edit | Back in time (1 revision) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures

AltStyle によって変換されたページ (->オリジナル) /