MCPcopy Create free account
hub / github.com/MrKepzie/Natron / tryLock

Method tryLock

Engine/Node.cpp:8026–8041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8024}
8025
8026bool
8027Node::tryLock(const boost::shared_ptr<Image> & image)
8028{
8029 QMutexLocker l(&_imp->imagesBeingRenderedMutex);
8030 std::list<boost::shared_ptr<Image> >::iterator it =
8031 std::find(_imp->imagesBeingRendered.begin(), _imp->imagesBeingRendered.end(), image);
8032
8033 if ( it != _imp->imagesBeingRendered.end() ) {
8034 return false;
8035 }
8036 ///Okay the image is not used by any other thread, claim that we want to use it
8037 assert( it == _imp->imagesBeingRendered.end() );
8038 _imp->imagesBeingRendered.push_back(image);
8039
8040 return true;
8041}
8042
8043void
8044Node::unlock(const boost::shared_ptr<Image> & image)

Callers 15

initGlMethod · 0.45
getPatternCacheMethod · 0.45
updatePatternCacheMethod · 0.45
appendBufferedFrameMethod · 0.45
getFromBufferAndEraseMethod · 0.45
appendRunnableMethod · 0.45
getRunnableIteratorMethod · 0.45

Calls 3

beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected