MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / lockRead

Method lockRead

deps/physx/physx/source/physx/src/NpScene.cpp:2731–2741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2729#endif // NP_ENABLE_THREAD_CHECKS
2730
2731void NpScene::lockRead(const char* /*file*/, PxU32 /*line*/)
2732{
2733 // increment this threads read depth
2734 ThreadReadWriteCount localCounts (TlsGetValue(mThreadReadWriteDepth));
2735 localCounts.readLockDepth++;
2736 TlsSetValue(mThreadReadWriteDepth, localCounts.getData());
2737
2738 // if we are the current writer then increment the reader count but don't actually lock (allow reading from threads with write ownership)
2739 if(localCounts.readLockDepth == 1)
2740 mRWLock.lockReader(mCurrentWriter != Thread::getId());
2741}
2742
2743void NpScene::unlockRead()
2744{

Callers 4

TickMethod · 0.80
runMethod · 0.80
sendEntireSceneMethod · 0.80
PxSceneReadLockMethod · 0.80

Calls 4

TlsGetValueFunction · 0.50
TlsSetValueFunction · 0.50
getDataMethod · 0.45
lockReaderMethod · 0.45

Tested by

no test coverage detected