         else if activityVisibleCount < Int.max {
             activityVisibleCount += 1
         }
+        
+        lock.unlock()
     }
     
     public func hide() {
+        lock.lock()
+        
         if activityVisibleCount == 1 {
             UIApplication.sharedApplication().networkActivityIndicatorVisible = false
             activityVisibleCount = 0

//
//  ApplicationNetworkActivityIndicator.swift
//  FranticApparatusDemo
//
//  Created by Justin Kolb on 5/14/16.
//  Copyright © 2016 Justin Kolb. All rights reserved.
//

import UIKit

public final class ApplicationNetworkActvityIndicator : NetworkActivityIndicator {
    private var activityVisibleCount: Int

    public init() {
        self.activityVisibleCount = 0
    }
    

        else if activityVisibleCount > 0 {
            activityVisibleCount -= 1
        }
        
        lock.unlock()
    }
}
