Blender Git Commit Log

Git Commits -> Revision 0fe7446

Revision 0fe7446 by Bastien Montagne (master)
October 8, 2016, 12:51 (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: 0fe7446a308028545b7d0e73d797824bfc090c17
Parent Commit: 0a2a006
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