Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from deprecated tbb::atomic to std::atomic #5

Open
wants to merge 1 commit into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/render/util/Arena.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ArenaBlockPool : private util::RefCount<ArenaBlockPool, util::AlignedDelet

protected:
unsigned mBlockSize;
tbb::atomic<unsigned> mTotalBlocks;
std::atomic<unsigned> mTotalBlocks;

CACHE_ALIGN util::ConcurrentSList mFreeBlocks;
};
Expand Down
4 changes: 1 addition & 3 deletions lib/render/util/MiscUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
// Include this before any other includes!
#include <scene_rdl2/common/platform/Platform.h>

#include <tbb/atomic.h>

namespace scene_rdl2 {
namespace util {

template<typename T>
struct CACHE_ALIGN CacheLineAtomic : public tbb::atomic<T>
struct CACHE_ALIGN CacheLineAtomic : public std::atomic<T>
{
};

Expand Down
4 changes: 2 additions & 2 deletions tests/lib/render/util/TestMemPool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ typedef uint64_t EntryType;
typedef MemPool<MemBlockType, EntryType> LocalMemPool;

// Counter to hand out unique indices to TLSProxy objects.
tbb::atomic<unsigned> gNextTLSIndex;
std::atomic<unsigned> gNextTLSIndex;

// This is a lightweight object which we put into a tbb::enumerable_thread_specific
// container so that we can map OS thread ids to consistent top level ThreadLocalState
// objects when running parallel_for loops in the update phase of the frame.
struct TLSProxy
{
TLSProxy() : mTLSIndex(gNextTLSIndex.fetch_and_increment()) {}
TLSProxy() : mTLSIndex(gNextTLSIndex++) {}
unsigned mTLSIndex;
};

Expand Down