 final public class SemaphoreChan: ChannelType
 {
   private let semaphore: dispatch_semaphore_t
-
-  // housekeeping variables
-
-  private var readerCount: Int32 = 0
+  private var lock: Int32 = 0
 
   public init(_ newElement: dispatch_semaphore_t)
   {


  // Computed property accessors

  final public var isEmpty: Bool
  {
    return readerCount > 0
  }

  final public var isFull: Bool
  {
    return readerCount < 1
  }

  /**
    Determine whether the channel has been closed
  */

  final public var isClosed: Bool { return true }

  /**
    Close the channel

    Any items still in the channel remain and can be retrieved.
    New items cannot be added to a closed channel.

    It could be considered an error to close a channel that has already
    been closed. The actual reaction shall be implementation-dependent.
  */

  public func close()
  {
  }

  /**
    Fail to append an element to the channel

    This method will not block because only one send operation
    can occur in the lifetime of this channel, and it has already happened on init.

    :param: element the new element to be added to the channel.
    :return: false

//
//  semaphore-chan.swift
//  concurrency
//
//  Created by Guillaume Lessard on 2015-02-11.
//  Copyright (c) 2014 Guillaume Lessard. All rights reserved.
//

