チェンジセット 2753
- コミット日時:
- 2009/05/29 23:48:01 (3 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
air/AirDao/src/com/seacolorswind/dbi/AirDao.as
r2443 r2753 114 114 public function create(entity:Object, callback:Function = null, errorHandler:Function = null):void { 115 115 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)); 117 117 } else { 118 118 ThreadQueue.addThread(resource, new CreateThread(resource, entity, callback, errorHandler)); air/AirDao/src/com/seacolorswind/dbi/Queue.as
r2443 r2753 69 69 logger.debug("addQueue({0})", arguments); 70 70 _waitingQueues.push(queue); 71 notify(); 71 72 } 72 73 /** … … 75 76 public function get numQueues():int { 76 77 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); 78 79 } 79 80 /** … … 105 106 logger.debug("runQueue({0})", arguments); 106 107 if (_waitingQueues.length > 0) { 107 var queue:Thread= _waitingQueues.shift();108 currentQueue = _waitingQueues.shift(); 108 109 109 queue.start();110 queue.join();110 currentQueue.start(); 111 currentQueue.join(); 111 112 112 113 next(runQueue); … … 117 118 } 118 119 } 120 121 protected var currentQueue:Thread; 119 122 /** 120 123 * 全てのキューを実行した後に呼び出されるメソッドです。 121 124 */ 122 125 protected function destory(e:Event = null):void { 123 if (_waitingQueues.length > 0)124 next(run);126 next(run); 127 wait(); 125 128 } 126 129 /** air/AirDao/src/com/seacolorswind/dbi/ThreadQueue.as
r2443 r2753 81 81 82 82 var _queueThread:Queue = _queueThreads[resource]; 83 if (!_queueThread || _queueThread.state == ThreadState.TERMINATED) {83 if (!_queueThread) { 84 84 _queueThread = new Queue(resource); 85 85 } … … 97 97 */ 98 98 protected static var _queueThreads:Dictionary = new Dictionary(); 99 /**100 * @private101 */102 protected static var _queueThread:Queue;103 99 } 104 100

