+ # announce the write lock
+ # and wait $timeout seconds for
+ # references == 0 (no shared locks set)
+ #
+ &simple_lock ($filename,$timeout) or return 0;
+ for (0..$timeout) {
+ # lock reference counter
+ # or fail
+ #
+ unless (&simple_lock (&reffile($filename),$timeout)) {
+ &simple_unlock($filename,$timeout);
+ return 0;
+ }
+
+ # ready if we have no shared locks
+ #