History

use tryLock in some cases where we don't want to block and pass already locked to the findParticleByID() in scripting interface

ZappoMan committed 12 years ago

Commit 289be041 parent 5b825ec3 files · +17 −10Browse files

Showing the changes to interface/src/ParticleTreeRenderer.cpp (1 of 3 files). Show all

Unified · Split

interface/src/ParticleTreeRenderer.cpp+5−4
@@ -32,10 +32,11 @@ void ParticleTreeRenderer::init() { · 31 unmodified lines
3232
3333 void ParticleTreeRenderer::update() {
3434 if (_tree) {
35− ParticleTree* tree = (ParticleTree*)_tree;
36− _tree->lockForWrite();
37− tree->update();
38− _tree->unlock();
35+ ParticleTree* tree = static_cast<ParticleTree*>(_tree);
36+ if (tree->tryLockForWrite()) {
37+ tree->update();
38+ tree->unlock();
39+ }
3940 }
4041 }
4142

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t