Use atomic operations in task pool

This ensures proper values of currently running tasks in the pool
(previously difference between mutex locks when acquiring new job
and releasing it might in theory give wrong values).
Cycles: Use lock in the memory statistics

CPU rendering is allowed to allocate memory from multiple threads,
which means statistics need to be avare of this.
Followup to previous linked list commit

Windows doesn't have __func__ and utildefines was never included.
Fixes for atomic operations when building with MSVC
Cycles: Tweak to the include paths after recent atomics change

Who could knew that include directories are not inherited in scons..
Enable sm52 for linux buildbot

Status of other builders:
- Windows are not known for me, would ask Martijn to look into
- OSX buildbot still needs a CUDA toolkit update
Cycles: Enable native sm_52 kernel for Windows.
Cycles: Remove workaround for missing sm_52 kernel, now we require it for Maxwell cards.
Fix T42767: Subsurfacing union boolean with same-named UVs crashes Blender

Was own mistake in handling custom data layers in boolean modifier.

Campbell, do you mind double-checking if it's all correct?
Freestyle: Avoid quietly ignoring errors in parameter_editor.lineset_pre callbacks.
Tex Paint: hide selected face-mask edges

Internal selected edges were distracting when painting images.

Also remove unused flag.
Fixes for T41168

after the completion of the action in "Flipper", layer is removed and the actuator mistakenly receive zero when trying to get the current frame

Patch Author: avrprj

Reviewers: moguri

Projects: #game_logic

Differential Revision: https://developer.blender.org/D906
BGE: Fix Rigid body constraint deletion

Fix for T41294.
Rigid body constraints are not deleted, if the corresponding game objects are deleted.

Reviewers: moguri

Differential Revision: https://developer.blender.org/D701
Fix potential bug (though rather unlikely) - MAX_ID_NAME is 66 now!
Cycles: Use 16 bytes aligned closures in OSL

This solves bugs like T42210 which are caused by compiler being
smart and using some SSE instructions to operate with closure
classes, which was failing because those classes are not allocated
by the regular allocator but allocated in memory pool in OSL.

With newer versions of OSL it is now possible to force closure
classes being aligned to a given boundary and this commit uses
this new functionality.

Unfortunately, it means we're no longer compatible with older
versions of OSL, only latest git version from upstream and our
branch at github are supported:

  https://github.com/Nazg-Gul/OpenShadingLanguage/tree/blender-fixes

For OSX and Windows it's not an issue because libraries are
already updated there, Linux users would need to run install_deps
script.
Cycles: Remove workaround in ShaderClosure

Since the aligned allocation of shader closures in OSL memory pool
this workaround is no longer needed.

Also put a comment which describes the desired layout of the structure
so array of shader closures is all nicely aligned.
Make sure materials are updated before passing to renderer in game
engine - report by Dalai on irc.
Fix typos.
Cycles: Support logging when building with SCons

Basically, title says ti all, the option is called WITH_BF_CYCLES_LOGGING
Cycles: Enable logging by default

Default configuration already includes libmv and glog, so all
the dependencies are met. And logging is nice to have anyway.

This wouldn't give any slowdown, because all the logging is
silenced unless '--debug-cycles', plus no logging is done
from the speed critical code.