 
 private struct Node<T>
 {
-  var nptr: COpaquePointer = nil
-  var elem: UnsafeMutablePointer<T>
+  var nptr: UnsafeMutablePointer<Void> = nil
+  let elem: UnsafeMutablePointer<T>
 
   init(_ p: UnsafeMutablePointer<T>)
   {

  public func dequeue() -> T?
  {
    OSSpinLockLock(&hlock)
    // ideally head.memory.next would be read atomically.
    // this is the one possible collision between dequeue() and enqueue()
    let next = head.memory.next
    if next != nil

    if node == nil
    {
      node = UnsafeMutablePointer<Node<T>>.alloc(1)
      node.memory = Node(UnsafeMutablePointer<T>.alloc(1))
    }
    node.memory.next = nil
    node.memory.elem.initialize(newElement)

    OSSpinLockLock(&tlock)
    // hopefully tail.memory.next is stored atomically
    // this is the one possible collision between dequeue() and enqueue()
    tail.memory.next = node
    tail = node
    OSSpinLockUnlock(&tlock)
