10/04/85 set_lock_ The set_lock_ subroutine enables cooperating processes to coordinate their use of shared resources. Entry points in set_lock_: (List is generated by the help command) :Entry: lock: 10/04/85 set_lock_$lock Function: This entry point attempts to place the lock identifier of the calling process in the given lock word. Usage: declare set_lock_$lock entry (bit(36) aligned, fixed bin, fixed bin(35)); call set_lock_$lock (lock_word, wait_time, code); Arguments: lock_word is the word to be locked. (Input/Output) wait_time indicates the length of real time, in seconds, that the set_lock_$lock entry point should wait for a validly locked lock word to be unlocked before returning unsuccessfully. (Input) A value of -1 indicates no time limit. code is a standard status code. (Output) It can be one of the following: error_table_$invalid_lock_reset indicates that the lock word was successfully locked, but the lock word previously contained an invalid lock identifier that was overwritten error_table_$locked_by_this_process indicates that the lock word already contained the lock identifier of the calling process and was not modified error_table_$lock_wait_time_exceeded indicates that the lock word contained a valid lock identifier of another process and could not be locked in the given time limit error_table_$no_w_permission indicates that calling process does not have proper write permission to lock_word Notes: It is suggested that set_lock_$lock be called as follows for applications where efficiency is important: if ^stacq (lock_word, static_var_initialized_to_lock_id, ""b) then call set_lock_$lock (lock_word, wait_time, code); else code = 0; :Entry: unlock: 10/04/85 set_lock_$unlock Function: This entry point attempts to reset a given lock word to "0"b and is successful if the lock word contained the lock identifier of the calling process. Usage: declare set_lock_$unlock entry (bit(36) aligned, fixed bin (35)); call set_lock_$unlock (lock_word, code); Arguments: lock_word is the lock word to be reset. (Input/Output) code is a standard status code. (Output) error_table_$lock_not_locked indicates that the lock was not locked error_table_$locked_by_other_process indicates that the lock was not locked by this process and therefore was not unlocked error_table_$no_w_permission indicates that calling process does not have proper write permission to lock_word Notes: It is suggested that set_lock_$unlock be called as follows for applications where efficiency is important: if ^stacq (lock_word, ""b, static_var_initialized_to_lock_id) then call set_lock_$unlock (lock_word, code); else code = 0; ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved