Page MenuHome

BLI: Use TBB spin_mutex as SpinLock implementation
ClosedPublic

Authored by Sergey Sharybin (sergey) on Jul 2 2020, 4:45 PM.

Details

Summary

BLI: Use TBB spin_mutex as SpinLock implementation

When building without TBB use native to the platform spin lock
implementation. For Windows it is an atomic-based busy-wait,
for Linux it is pthreads' spin lock.

For macOS it is a mutex lock. The reason behind this is to stop
using atomics library which has been declared deprecated in SDK
version 10.12. So this changes fixes a lot of noisy warnings on
the newer SDK.

Diff Detail

Repository
rB Blender

Event Timeline

Sergey Sharybin (sergey) requested review of this revision.Jul 2 2020, 4:45 PM
Sergey Sharybin (sergey) created this revision.

iAdded static assert to ensure SpinLock alignment

Sergey Sharybin (sergey) retitled this revision from BLI: Switch threads implementation file to C++ to BLI: Use TBB spin_mutex as SpinLock implementation.Jul 2 2020, 4:51 PM
Sergey Sharybin (sergey) edited the summary of this revision. (Show Details)

Raise SPinLock back to uint32_t. This allows to fit TBB's spin_mutex
definition for PPC macOS.

This revision is now accepted and ready to land.Jul 2 2020, 5:41 PM