チェンジセット 2753

差分発生行の前後
無視リスト:
コミット日時:
2009/05/29 23:48:01 (3 年前)
コミッタ:
Seacolor
ログメッセージ:

レコードの作成/更新/削除でデッドロックになってしまう問題を修正

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • air/AirDao/src/com/seacolorswind/dbi/AirDao.as

    r2443 r2753  
    114114                public function create(entity:Object, callback:Function = null, errorHandler:Function = null):void { 
    115115                        if (entity is Array) { 
    116                                 ThreadQueue.addThread(resource, new BatchCreateThread(resource, entity as Array, callback, errorHandler)) 
     116                                ThreadQueue.addThread(resource, new BatchCreateThread(resource, entity as Array, callback, errorHandler)); 
    117117                        } else { 
    118118                                ThreadQueue.addThread(resource, new CreateThread(resource, entity, callback, errorHandler)); 
  • air/AirDao/src/com/seacolorswind/dbi/Queue.as

    r2443 r2753  
    6969                        logger.debug("addQueue({0})", arguments); 
    7070                        _waitingQueues.push(queue); 
     71                        notify(); 
    7172                } 
    7273                /** 
     
    7576                public function get numQueues():int { 
    7677                        logger.debug("queues: {0}, state: {1}", _waitingQueues.length, state); 
    77                         return _waitingQueues.length + (state == ThreadState.TERMINATED ? 0 : 1); 
     78                        return _waitingQueues.length + (!currentQueue || currentQueue.state == ThreadState.TERMINATED ? 0 : 1); 
    7879                } 
    7980                /** 
     
    105106                        logger.debug("runQueue({0})", arguments); 
    106107                        if (_waitingQueues.length > 0) { 
    107                                 var queue:Thread = _waitingQueues.shift(); 
     108                                currentQueue = _waitingQueues.shift(); 
    108109                                 
    109                                 queue.start(); 
    110                                 queue.join(); 
     110                                currentQueue.start(); 
     111                                currentQueue.join(); 
    111112                                 
    112113                                next(runQueue); 
     
    117118                        } 
    118119                } 
     120                 
     121                protected var currentQueue:Thread; 
    119122                /** 
    120123                 * 全てのキューを実行した後に呼び出されるメソッドです。 
    121124                 */ 
    122125                protected function destory(e:Event = null):void { 
    123                         if (_waitingQueues.length > 0) 
    124                                next(run); 
     126                        next(run); 
     127                        wait(); 
    125128                } 
    126129                /** 
  • air/AirDao/src/com/seacolorswind/dbi/ThreadQueue.as

    r2443 r2753  
    8181                         
    8282                        var _queueThread:Queue = _queueThreads[resource]; 
    83                         if (!_queueThread || _queueThread.state == ThreadState.TERMINATED) { 
     83                        if (!_queueThread) { 
    8484                                _queueThread = new Queue(resource); 
    8585                        } 
     
    9797                 */ 
    9898                protected static var _queueThreads:Dictionary = new Dictionary(); 
    99                 /** 
    100                  * @private 
    101                  */ 
    102                 protected static var _queueThread:Queue; 
    10399        } 
    104100