1# Copyright (c) 2012 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 170 unchanged lines hidden (view full) --- 179 # longer be drained. 180 def _drain(): 181 all_drained = False 182 dm = internal.drain.createDrainManager() 183 unready_objs = sum(obj.drain(dm) for obj in root.descendants()) 184 # If we've got some objects that can't drain immediately, then simulate 185 if unready_objs > 0: 186 dm.setCount(unready_objs) |
187 #WARNING: if a valid exit event occurs while draining, it will not 188 # get returned to the user script 189 exit_event = simulate() 190 while exit_event.getCause() != 'Finished drain': 191 exit_event = simulate() |
192 else: 193 all_drained = True 194 internal.drain.cleanupDrainManager(dm) 195 return all_drained 196 197 all_drained = _drain() 198 while (not all_drained): 199 all_drained = _drain() --- 122 unchanged lines hidden --- |