Revision 51b92d1c
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/library/mesh/DeferredJobs.java | ||
---|---|---|
159 | 159 |
mJob = job; |
160 | 160 |
} |
161 | 161 |
|
162 |
void execute() |
|
162 |
synchronized void execute()
|
|
163 | 163 |
{ |
164 |
JobNode node; |
|
165 |
int numPrev = mPrevJobs.size(); |
|
166 |
|
|
167 |
for(int i=0; i<numPrev; i++) |
|
164 |
if( mPrevJobs!=null ) |
|
168 | 165 |
{ |
169 |
node = mPrevJobs.get(0); // removeNode() rips the executed job out, thus the 0 |
|
170 |
node.execute(); |
|
171 |
} |
|
166 |
JobNode node; |
|
167 |
int numPrev = mPrevJobs.size(); |
|
168 |
|
|
169 |
for(int i=0; i<numPrev; i++) |
|
170 |
{ |
|
171 |
node = mPrevJobs.get(0); // removeNode() rips the executed job out, thus the 0 |
|
172 |
node.execute(); |
|
173 |
} |
|
172 | 174 |
|
173 |
removeNode(this); |
|
174 |
mJob.execute(); |
|
175 |
removeNode(this); |
|
176 |
mJob.execute(); |
|
177 |
} |
|
175 | 178 |
} |
176 | 179 |
|
177 |
void clear() |
|
180 |
synchronized void clear()
|
|
178 | 181 |
{ |
179 | 182 |
mPrevJobs.clear(); |
180 | 183 |
mPrevJobs = null; |
Also available in: Unified diff
fix for a crasher.