| 2705 | } |
| 2706 | |
| 2707 | void 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 | // |
no test coverage detected