   yield: (yieldee=@choose_next_thread()) ->
     debug "TE(yield): yielding #{thread_name @, @curr_thread} to #{thread_name @, yieldee}"
     old_thread_sf = @curr_frame()
-    old_thread = @curr_thread
     @curr_thread = yieldee
     new_thread_sf = @curr_frame()
     new_thread_sf.runner = => @meta_stack().pop()

      my_sf.runner = =>
        my_sf.runner = null
        ct.$meta_stack = @meta_stack()
        ct.main = true  # designates that this is the main thread
        @curr_thread = ct
        @curr_thread.$isAlive = true
        @thread_pool.push @curr_thread

    @lock_counts = {}  # map from monitor -> count
    @waiting_threads = {}  # map from monitor -> list of waiting thread objects
    @thread_pool = []
    @curr_thread = {$meta_stack: new root.CallStack()}

  init_threads: ->
    # initialize thread objects
