 	/// - Returns: a signal producer that returns the file data or an error
 	public func contents(of file: File) -> SignalProducer<Data, FileError> {
 		return SignalProducer<Data, FileError>() { observer, _ in
-			self.taskLock.lock();
-			defer { self.taskLock.unlock() }
-			guard nil == self.downloadInProgressSignal else
-			{
-				//download is in progress. wait until completed. use ! because should not change while taskLock is locked
-				_ = self.downloadInProgressSignal!.observeCompleted {
+			self.taskLockQueue.sync {
+				guard nil == self.downloadInProgressSignal else
+				{
+					//download is in progress. wait until completed. use ! because should not change while taskLock is locked
+					_ = self.downloadInProgressSignal!.observeCompleted {
+						self.loadContents(file: file, observer: observer)
+					}
+					return
+				}
+				//want to release lock before actually load the contents
+				DispatchQueue.main.async {
 					self.loadContents(file: file, observer: observer)
 				}
-				return
-			}
-			//want to release lock before actually load the contents
-			DispatchQueue.main.async {
-				self.loadContents(file: file, observer: observer)
 			}
 		}
 	}

		task = cache.urlSession!.downloadTask(with: request)
	}
}


	fileprivate var downloadInProgressSignal: Signal<Bool, NoError>?
	fileprivate var downloadInProgressObserver: Signal<Bool, NoError>.Observer?
	fileprivate let saveQueue: DispatchQueue
	fileprivate let taskLockQueue: DispatchQueue
	
	lazy var fileCacheUrl: URL = { () -> URL in
		var fileDir: URL? = nil
