MCPcopy Create free account
hub / github.com/ImageEngine/cortex / lockDirectory

Method lockDirectory

src/IECore/StreamIndexedIO.cpp:2707–2717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2705}
2706
2707void StreamIndexedIO::Index::lockDirectory( MutexLock &lock, const DirectoryNode *n, bool writeAccess ) const
2708{
2709 if ( n->subindexChildren() )
2710 {
2711 // choose one of the mutexes from the pool (in a deterministic way)
2712 size_t v = (size_t)n / sizeof(DirectoryNode*);
2713 unsigned int m = ( (v + 1) / 3 ) % MAX_MUTEXES;
2714
2715 lock.acquire( m_mutexes[ m ], writeAccess );
2716 }
2717}
2718
2719///////////////////////////////////////////////
2720//

Callers 5

hasChildMethod · 0.80
directoryChildMethod · 0.80
dataChildInfoMethod · 0.80
childNamesMethod · 0.80
entryMethod · 0.80

Calls 1

subindexChildrenMethod · 0.80

Tested by

no test coverage detected