Blender Git Commit Log

Git Commits -> Revision 4dbcbf5

October 19, 2016, 12:26 (GMT)
BLI_task: fix case were some pool could work in more threads than allowed.

We were checking for number of tasks from given pool already active, and
then atomically increasing it if allowed - this is not correct, number
could be increased by another thread between check and atomic op!

Atomic primitives are nice, but you must be very careful with *how* you
use them... Now we atomically increase counter, check result, and if we
end up over max value, abort and decrease counter again.

Spotted by Sergey, thanks!

Commit Details:

Full Hash: 4dbcbf5ba94ad75e9a385e4d81d042347c5d4649
Parent Commit: 117329a
Committed By: Sergey Sharybin
Lines Changed: +5, -3

1 Modified Path:

/source/blender/blenlib/intern/task.c (+5, -3) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021