 
 import Dispatch
 
-protocol Locking {
+public protocol Locking {
   mutating func lock()
   mutating func unlock()
 }
 
-extension Locking {
+public extension Locking {
   mutating func locker<T>(_ locked: () throws -> T) rethrows -> T {
     lock()
     defer { unlock() }

  }
}

func makeLocking(isFair: Bool = false) -> Locking {
  #if os(Linux)
    return DispatchSemaphore(value: 1)
  #else

}

extension DispatchSemaphore: Locking {
  public func lock() {
    self.wait()
  }

  public func unlock() {
    self.signal()
  }
}
