diff options
author | Bryan Drewery <bryan@shatow.net> | 2015-04-16 05:45:07 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2015-04-17 01:12:45 +0300 |
commit | 4b91b68d0a6bc083a39069553fae7b0c7fad7cd4 (patch) | |
tree | 325508921da2893cd6f9de021d92b24d02b24b4a /.gitignore | |
parent | ca3cbc6d5522cca90613b2b45fa0117efbc04118 (diff) |
Rewrite lock_acquire() to not spam 'sleep 0.1'
This now uses a lockf(1)-inspired helper named 'locked_mkdir'. It uses
lockf(1)-style locking with open(O_EXLOCK) to serialize 'locked_mkdir'
itself for the mkdir(2) call. The act of creating a directory is
considered obtaining the lock since it is not bound to a specific
process and is atomic. If the directory already exists (or is a file)
then kqueue(2) is used to wait to mkdir(2) once it is deleted. A timeout
is added that is shared between the O_EXLOCK lock and kqueue(2) wait.
Diffstat (limited to '.gitignore')
-rw-r--r-- | .gitignore | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -13,6 +13,7 @@ /cpdup /dirempty /dirwatch +/locked_mkdir /jexecd /make_index /nc |