[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/09: syscalls: 'with-file-lock' expands to a call to 'call-with-file-l
From: |
guix-commits |
Subject: |
04/09: syscalls: 'with-file-lock' expands to a call to 'call-with-file-lock'. |
Date: |
Wed, 5 Jun 2019 17:11:22 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 89ceb86ad415ea92450ebda60359a7ee0ec79eb6
Author: Ludovic Courtès <address@hidden>
Date: Mon Jun 3 16:24:31 2019 +0200
syscalls: 'with-file-lock' expands to a call to 'call-with-file-lock'.
* guix/build/syscalls.scm (call-with-file-lock): New procedure.
(with-file-lock): Expand to a call to 'call-with-file-lock'.
---
guix/build/syscalls.scm | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 04fbebb..3af41f2 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -1083,17 +1083,19 @@ exception if it's already taken."
(close-port port)
#t)
-(define-syntax-rule (with-file-lock file exp ...)
- "Wait to acquire a lock on FILE and evaluate EXP in that context."
+(define (call-with-file-lock file thunk)
(let ((port (lock-file file)))
(dynamic-wind
(lambda ()
#t)
- (lambda ()
- exp ...)
+ thunk
(lambda ()
(unlock-file port)))))
+(define-syntax-rule (with-file-lock file exp ...)
+ "Wait to acquire a lock on FILE and evaluate EXP in that context."
+ (call-with-file-lock file (lambda () exp ...)))
+
;;;
;;; Miscellaneous, aka. 'prctl'.
- branch master updated (c0f6eeb -> d088d5c), guix-commits, 2019/06/05
- 04/09: syscalls: 'with-file-lock' expands to a call to 'call-with-file-lock'.,
guix-commits <=
- 02/09: gnu: minizip: Do not install crypt.h., guix-commits, 2019/06/05
- 08/09: accounts: Close database before renaming it., guix-commits, 2019/06/05
- 01/09: guix package: Do not list environment variables that need to be set., guix-commits, 2019/06/05
- 03/09: syscalls: Add 'with-file-lock' macro., guix-commits, 2019/06/05
- 09/09: accounts: Call 'fdatasync' when writing databases., guix-commits, 2019/06/05
- 07/09: nar: Really lock store files., guix-commits, 2019/06/05
- 05/09: syscalls: 'with-lock-file' catches ENOSYS., guix-commits, 2019/06/05
- 06/09: activation: Lock /etc/.pwd.lock before accessing databases., guix-commits, 2019/06/05