'Return the ThreadFrame() of the current thread.'

def gettf(self):

    cur_thread = currentThread()
    acc = self.getthreadaccount()
    with self.tframe_lock:
        try:
            if (cur_thread in self.threadframes[acc]):
                return self.threadframes[acc][cur_thread]
        except KeyError:
            self.threadframes[acc] = {}
            self.availablethreadframes[acc] = deque()
        if len(self.availablethreadframes[acc]):
            tf = self.availablethreadframes[acc].popleft()
            tf.std_color()
        else:
            tf = self.getaccountframe(acc).get_new_tframe()
        self.threadframes[acc][cur_thread] = tf
    return tf
