   ###
 
   first: (callback) ->
-    lock()
-    @self.first afterSeek callback
+    @self.first @_wrapSeek callback
 
 
   ###


exports.Iterator = class Iterator

  busy = false
  isValid = false
  keybuf = null
  valbuf = null

  lock = ->
    throw new Error 'Concurrent operations not supported' if busy
    busy = true

  unlock = ->
    throw new Error 'Not locked' unless busy
    busy = false

  afterSeek = (callback) -> (err, valid, key, val) ->
    unlock()
    isValid = valid
    keybuf = key
    valbuf = val
    callback err if callback

  getKey = (options = {}) ->
    unless keybuf
      return null
    else unless options.as_buffer
      keybuf.toString 'utf8'
    else
      keybuf

  getValue = (options = {}) ->
    unless valbuf
      return null
    else unless options.as_buffer
      valbuf.toString 'utf8'
    else
      valbuf


  ###

      callback = options
      options = null

    key = @_getKey options
    val = @_getVal options
    callback? null, key, val
    [key, val]
