MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / lockRead

Method lockRead

physx/source/physx/src/NpScene.cpp:2681–2691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2679#endif // NP_ENABLE_THREAD_CHECKS
2680
2681void NpScene::lockRead(const char* /*file*/, PxU32 /*line*/)
2682{
2683 // increment this threads read depth
2684 ThreadReadWriteCount localCounts (TlsGetValue(mThreadReadWriteDepth));
2685 localCounts.readLockDepth++;
2686 TlsSetValue(mThreadReadWriteDepth, localCounts.getData());
2687
2688 // if we are the current writer then increment the reader count but don't actually lock (allow reading from threads with write ownership)
2689 if(localCounts.readLockDepth == 1)
2690 mRWLock.lockReader(mCurrentWriter != Thread::getId());
2691}
2692
2693void NpScene::unlockRead()
2694{

Callers 3

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