Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2017-11-26 01:14:54 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-11-26 01:14:54 +0300
commit3c1f3c02c60f6ace330c53299640a6ca6499b6b9 (patch)
tree3ec4ee323c882963e0761994abdcf63cd9b4926f /source/blender/editors/gpencil
parentdd6c918b2ccc6ca546e9a8c5cb5ac169a59e8316 (diff)
Fix for Fix (c): broken atomic lock in own bmesh code.
That was a nasty one, Debug build would never have any issue (even tried with 64 threads!), but Release build would deadlock nearly immediately, even with only 2 threads! What happened here (I think) is that gcc optimizer would generate a specific path endlessly looping when initial value of virtual_lock was FLT_MAX, by-passing re-assignment from v_no[0] and the atomic cas completely. Which would have been correct, should v_no[0] not have been shared (and modified) by multiple threads. ;) Idea of that (broken) for loop was to avoid completely calling the atomic cas as long as v_no[0] was locked by some other thread, but... Guess the avoided/missing memory barrier was the root of the issue here. Lesson of the evening: Remember kids, do not trust your compiler to understand all possible threading-related side effects, and be explicit rather than elegant when using atomic ops! Side-effect lesson: do check both release and debug builds when messing with said atomic ops...
Diffstat (limited to 'source/blender/editors/gpencil')
0 files changed, 0 insertions, 0 deletions