チェンジセット 547

差分発生行の前後
無視リスト:
コミット日時:
2008/05/31 03:09:26 (6 ヶ月前)
コミッタ:
yossy
ログメッセージ:

Thread(soumen): イベントハンドラはすぐ実行されるように変更

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/Thread/branches/soumen/src/org/libspark/thread/Thread.as

    r540 r547  
    619619                         
    620620                        // イベントを保存 
    621                         _event = e.clone()
     621                        _event = e
    622622                         
    623623                        // 該当するイベントハンドラを次の実行関数に設定 
     
    635635                        // state を実行状態に切り替える 
    636636                        _state = _runningState; 
     637                         
     638                        // 入れ子になる場合があるのでカレントスレッドを保存 
     639                        var current:Thread = _currentThread; 
     640                         
     641                        try { 
     642                                // そしてすぐ実行してみる 
     643                                internalExecute(null, this); 
     644                        } 
     645                        finally { 
     646                                // カレントスレッドを復元 
     647                                _currentThread = current; 
     648                        } 
    637649                } 
    638650                 
     
    677689                        } 
    678690                         
     691                        return internalExecute(error, errorThread); 
     692                } 
     693                 
     694                private function internalExecute(error:Object, errorThread:Thread):Boolean 
     695                { 
    679696                        if (_state == ThreadState.WAITING || _state == ThreadState.TIMED_WAITING) { 
    680697                                if (error != null) { 
     
    834851                                        // 自分の子スレッドを、孤児スレッドとしてトップレベルに移動する 
    835852                                        if (_children != null) { 
    836                                                 addToplevelThreads(children); 
     853                                                addToplevelThreads(_children); 
    837854                                                // 子スレッドは破棄 
    838855                                                _children = null;