Skip to content

[DocDB] Remove GetAtomicFlag/SetAtomicFlag #30321

@es1024

Description

@es1024

Jira Link: DB-20204

Description

We currently have the GetAtomicFlag/SetAtomicFlag functions:

template <class T>
T GetAtomicFlag(T* flag) {
  std::atomic<T>& atomic_flag = *pointer_cast<std::atomic<T>*>(flag);
  return atomic_flag.load(std::memory_order::relaxed);
}

template <class U, class T>
void SetAtomicFlag(U value, T* flag) {
  std::atomic<T>& atomic_flag = *pointer_cast<std::atomic<T>*>(flag);
  atomic_flag.store(value);
}

which provide dubious value and are additionally also undefined behavior (there does not exist a std::atomic<T> object at the address pointed to by flag). These should be removed.

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions