09-147r1 To: J3 From: Bill Long Subject: UTI's 159,160 - [UN]LOCK statements, C8 Date: 2009 February 12 References: 09-007, 09-102, 09-142 Discussion: Background information on lock variables in contained in paper 09-142. UTI 159 observes the need to clean up the wording describing the execution of LOCK and UNLOCK statements in 8.5.5. UTI 160 observes the need for better wording in 8.5.6 para 2. ------------ Edits to 09-007: [194:7] In 8.5.5 LOCK and UNLOCK statements, Constraint C852, replace "a lock variable (6.2.2)" with "a scalar of type LOCK_TYPE (13.8.2.16)". [194:8-10] In 8.5.5 LOCK and UNLOCK statements, replace para 1 with: "A lock variable is unlocked if its value is equal to that of LOCK_TYPE(). If it has any other value, it is locked. A lock variable is locked by an image if it was locked by execution of a LOCK statement on that image and has not been subsequently unlocked by execution of an UNLOCK statement on the same image." [195:1-13] In 8.5.5 LOCK and UNLOCK statements, replace the para 2-5 with: "Successful execution of a LOCK statement without an ACQUIRED_LOCK= specifier causes the lock variable to become locked by that image. If the lock variable is already locked by another image, execution of that LOCK statement causes the lock variable to become defined after the other image causes the lock variable to become unlocked. If the lock variable is unlocked, successful execution of a LOCK statement with an ACQUIRED_LOCK= specifier causes the lock variable to become locked by that image and the scalar logical variable to become defined with the value true. If the lock variable is already locked by a different image, its value is not changed and the scalar logical variable becomes defined with the value false. Successful execution of an UNLOCK statement causes the lock variable to become unlocked. An error condition occurs if the lock variable in a LOCK statement is already locked by the executing image. An error condition occurs if the lock variable in an UNLOCK statement is not already locked by the executing image. If an error condition occurs during execution of a LOCK or UNLOCK statement, the value of the lock variable is not changed." [196:2-10] In 8.5.6 STAT= and ERRMSG= specifiers in image control statements, make the following changes to para 1: [196:2] In the first sentence, replace "or SYNC MEMORY" with "SYNC MEMORY, LOCK, or UNLOCK" [196:3-7] Make the second sentence ("If execution of ... SYNC MEMORY statement.") and the third sentence ("If any other error ... STAT_STOPPED_IMAGE.") from para 1 into a new paragraph and replace "If execution of" at the beginning of the second sentence with: "If the STAT= specifier appears in a SYNC ALL or SYNC IMAGES statement and execution of" [196:new_para_2+] Move sentences 2-6 of paragraph 2 ([196:12-21]: If the STAT= specifier appears in a LOCK ... STAT_LOCKED, and STAT_LOCKED_OTHER_IMAGE.) into a new paragraph 3 that follows the paragraph above. In these sentences, replace "(\ref{})" with the appropriate references in clause 13 (twice), add a reference after STAT_LOCKED_OTHER_IMAGE, and remove "a STAT= specifier appears and" from the last sentence. [196:9-10] In the last sentence replace "or SYNC MEMORY" with "SYNC MEMORY, LOCK, or UNLOCK" and make this sentence a paragraph 4. [196:11-197:1] Delete anything remaining of the old paragraph 2. {The resulting paragraphs have this form: If the STAT= specifier appears, successful execution of the SYNC ALL, SYNC IMAGES, SYNC MEMORY, LOCK, or UNLOCK statements causes the specified variable to become defined with the value zero. If the STAT= specifier appears in a SYNC ALL or SYNC IMAGES statement and execution of one of these statements involves synchronization with ... SYNC MEMORY. If any other error occurs during execution of one of these statements ... different from the value of STAT_STOPPED_IMAGE. If the STAT= specifier appears in a LOCK statement ... STAT_LOCKED (13.8.2.22). If the STAT= specifier appears in an UNLOCK statement ... STAT_UNLOCKED (13.8.2.25). If the STAT= specifier appears in an UNLOCK statement ... STAT_LOCKED_OTHER_IMAGE (13.8.2.23). The named constants ... ISO_FORTRAN_ENV. If any other error occurs during execution of a LOCK or UNLOCK statement ... STAT_LOCKED_OTHER_IMAGE. If an error condition occurs during execution of a SYNC ALL, SYNC IMAGES, SYNC MEMORY, LOCK, or UNLOCK statement that does not contain the STAT= specifier, error termination is initiated. }