Changeset 13041 for OpenSceneGraph/trunk/src/osgDB/ImagePager.cpp
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgDB/ImagePager.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgDB/ImagePager.cpp
r12292 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 88 88 { 89 89 sort(); 90 90 91 91 databaseRequest = _requestList.front(); 92 92 databaseRequest->_requestQueue = 0; … … 127 127 if( isRunning() ) 128 128 { 129 129 130 130 _done = true; 131 131 132 132 switch(_mode) 133 133 { … … 154 154 OpenThreads::Thread::YieldCurrentThread(); 155 155 } 156 156 157 157 // _startThreadCalled = false; 158 158 } … … 167 167 168 168 osg::ref_ptr<ImagePager::ReadQueue> read_queue; 169 169 170 170 switch(_mode) 171 171 { … … 187 187 osg::ref_ptr<ImageRequest> imageRequest; 188 188 read_queue->takeFirst(imageRequest); 189 189 190 190 if (imageRequest.valid()) 191 191 { … … 219 219 OpenThreads::Thread::YieldCurrentThread(); 220 220 } 221 222 221 222 223 223 // go to sleep till our the next time our thread gets scheduled. 224 224 225 225 if (firstTime) 226 226 { 227 // do a yield to get round a peculiar thread hang when testCancel() is called 227 // do a yield to get round a peculiar thread hang when testCancel() is called 228 228 // in certain circumstances - of which there is no particular pattern. 229 229 YieldCurrentThread(); … … 246 246 _startThreadCalled = false; 247 247 _databasePagerThreadPaused = false; 248 248 249 249 _readQueue = new ReadQueue(this,"Image Queue"); 250 250 _completedQueue = new RequestQueue; … … 305 305 request->_attachmentIndex = attachmentIndex; 306 306 request->_requestQueue = _readQueue.get(); 307 307 308 308 _readQueue->add(request.get()); 309 309 … … 311 311 { 312 312 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_run_mutex); 313 313 314 314 if (!_startThreadCalled) 315 315 { 316 316 _startThreadCalled = true; 317 317 _done = false; 318 318 319 319 for(ImageThreads::iterator itr = _imageThreads.begin(); 320 320 itr != _imageThreads.end(); … … 323 323 (*itr)->startThread(); 324 324 } 325 325 326 326 } 327 327 } … … 354 354 } 355 355 } 356 356 357 357 _completedQueue->_requestList.clear(); 358 358 }
