09-147 To: J3 From: Bill Long Subject: UTI's 159,160 - [UN]LOCK statements, C8 Date: 2009 February 11 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:8-10] In 8.5.5 LOCK and UNLOCK statements, replace para 1 with: "A lock variable is unlocked if it has the value LOCK_TYPE(). If it has any other value, it is locked. A lock variable is locked by an image if it was set to locked by execution of a LOCK statement on that image and has not been subsequently set to unlocked by execution of an UNLOCK statement on the same image." [195:1-4] 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 be locked by that image. If the lock variable is locked by another image, execution of the LOCK statement does not complete until that image changes the lock variable to unlocked. If the lock variable is unlocked, successful execution of a LOCK statement with an ACQUIRED_LOCK= specifier causes the lock variable to be locked by that image and the scalar logical variable to become defined with the value true. Otherwise, the lock variable is not changed and the scalar logical variable becomes defined with the value false. Successful execution of an UNLOCK statement changes the lock variable to unlocked. An error condition occurs if the lock variable in a LOCK statement is locked by the executing image. An error condition occurs if the lock variable in an UNLOCK statement is not 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, para 1: [196:2] In the first sentence, replace "or SYNC MEMORY" with "SYNC MEMORY, LOCK, or UNLOCK" [209:3-7] Make the second sentence ("If execution of ... SYNC MEMORY statement.") and the third sentence ("If any other error ... STAT_STOPPED_IMAGE.") from paragraph 1 into a new paragraph and replace "If execution of" with "If the STAT= specifier appears in a SYNC ALL or SYNC IMAGES statement and execution of" [209:7+] Move sentences 2-6 of paragraph 2 into a new paragraph 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 separate paragraph. [192:11-193: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. }