summaryrefslogtreecommitdiffstats
path: root/libcxx/include/__atomic_support
blob: e53140cb569ebfa57277895f51c5bbee9f9ae997 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// -*- C++ -*-
//===------------------------ __atomic_support -----------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP___ATOMIC_SUPPORT
#define _LIBCPP___ATOMIC_SUPPORT

#include <__config>

template<typename T>
T __libcpp_sync_add_and_fetch(T *ptr, T value) {
  return __sync_add_and_fetch(ptr, value);
}

template<typename T>
T __libcpp_sync_fetch_and_add(T *ptr, T value) {
  return __sync_fetch_and_add(ptr, value);
}

template<typename T>
T __libcpp_sync_lock_test_and_set(T *ptr, T value) {
  return __sync_lock_test_and_set(ptr, value);
}

#endif //_LIBCPP___ATOMIC_SUPPORT
OpenPOWER on IntegriCloud