self.state=t.threadStates.RUNNING; try{ fn(this); self.state=t.threadStates.COMPLETE; }catch(e){ self.lastError=e; self.state=t.threadStates.ERROR; }