Displaying 2 results from an estimated 2 matches for "f_lock".
Did you mean:
  g_lock
  
2009 Nov 19
1
[PATCH] (Alternate?) locking patch
...xit 1
-  );
+	exit 1
+    | exn ->
+	perror "open: HACKING" exn;
+	exit 1 in
+
+  (* Acquire a lock so parallel builds won't try to run the generator
+   * twice at the same time.  Subsequent builds will wait for the
+   * first one to finish.
+   *)
+  (try Unix.lockf lock_fd Unix.F_LOCK 1
+   with
+   | exn ->
+       perror "lock: HACKING" exn;
+       exit 1);
 
   let close = output_to "src/guestfs_protocol.x" in
   generate_xdr ();
@@ -10339,4 +10360,7 @@ Run it from the top source directory using the command
    *)
   let chan = open_out "src/stamp...
2014 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
...automatically
+   * when the program exits for any reason.
+   *)
+  (match lockfile with
+  | None -> ()
+  | Some lockfile ->
+    if debug >= 1 then printf "supermin: acquiring lock on %s\n%!" lockfile;
+    let fd = openfile lockfile [O_WRONLY;O_CREAT] 0o644 in
+    lockf fd F_LOCK 0;
+  );
+
+  (* If the --if-newer flag was given, check the dates on input files,
+   * package database and output directory.  If the output directory
+   * does not exist, or if the dates of either input files or package
+   * database is newer, then we rebuild.  Else we can just exit.
+   *)
+...