The one exception is in Utility.Daemon. As long as a process only daemonizes once, which seems reasonable, and as long as it avoids calling checkDaemon once it's already running as a daemon, the fcntl locking gotchas won't be a problem there. Annex.LockFile has it's own separate lock pool layer, which has been renamed to LockCache. This is a persistent cache of locks that persist until closed. This is not quite done; lockContent stil needs to be converted.
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			557 B
			
		
	
	
	
		
			Haskell
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			557 B
			
		
	
	
	
		
			Haskell
		
	
	
	
	
	
{- Lock files
 | 
						|
 -
 | 
						|
 - Posix and Windows lock files are extremely different.
 | 
						|
 - This module does *not* attempt to be a portability shim, it just exposes
 | 
						|
 - the native locking of the OS.
 | 
						|
 -
 | 
						|
 - Posix fcntl locks have some gotchas. So, consider using
 | 
						|
 - Utility.LockPool instead of using this module directly.
 | 
						|
 -
 | 
						|
 - Copyright 2014 Joey Hess <id@joeyh.name>
 | 
						|
 -
 | 
						|
 - License: BSD-2-clause
 | 
						|
 -}
 | 
						|
 | 
						|
{-# LANGUAGE CPP #-}
 | 
						|
 | 
						|
module Utility.LockFile (module X) where
 | 
						|
 | 
						|
#ifndef mingw32_HOST_OS
 | 
						|
import Utility.LockFile.Posix as X
 | 
						|
#else
 | 
						|
import Utility.LockFile.Windows as X
 | 
						|
#endif
 |