* PathLocks::lockPaths: don't allow reacquiring a lock we already
hold.
This commit is contained in:
		
							parent
							
								
									455a7b9577
								
							
						
					
					
						commit
						e0d7e47862
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		|  | @ -161,10 +161,8 @@ void PathLocks::lockPaths(const PathSet & _paths, const string & waitMsg) | |||
| 
 | ||||
|         debug(format("locking path `%1%'") % path); | ||||
| 
 | ||||
|         if (lockedPaths.find(lockPath) != lockedPaths.end()) { | ||||
|             debug(format("already holding lock on `%1%'") % lockPath); | ||||
|             continue; | ||||
|         } | ||||
|         if (lockedPaths.find(lockPath) != lockedPaths.end()) | ||||
|             throw Error("deadlock: trying to re-acquire self-held lock"); | ||||
| 
 | ||||
|         AutoCloseFD fd; | ||||
|          | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue