This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lbianc
Recipients Arfrever, Joshua.J.Cogliati,, gustavotemple, jrincayc, lbianc, python-dev, vstinner
Date 2015-03-16.13:55:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>

For adding compatibility for atomics based on @Joshua.J.Cogliati change, I propose:

#ifndef Py_LIMITED_API
#ifndef Py_ATOMIC_H
#define Py_ATOMIC_H

#include "dynamic_annotations.h"

#include "pyconfig.h"

#if defined(HAVE_STD_ATOMIC)
#ifdef __cplusplus
#include <atomic>
#define _Atomic(T) atomic<T>
using namespace std;
#include <stdatomic.h>

#ifdef __cplusplus
extern "C" {

/* This is modeled after the atomics interface from C1x, according to
 * the draft at
 * Operations and types are named the same except with a _Py_ prefix
 * and have the same semantics.
 * Beware, the implementations here are deep magic.

#if defined(HAVE_STD_ATOMIC)

typedef enum _Py_memory_order {
    _Py_memory_order_relaxed = memory_order_relaxed,
    _Py_memory_order_acquire = memory_order_acquire,
    _Py_memory_order_release = memory_order_release,
    _Py_memory_order_acq_rel = memory_order_acq_rel,
    _Py_memory_order_seq_cst = memory_order_seq_cst
} _Py_memory_order;

typedef struct _Py_atomic_address {
    _Atomic (void) *_value;
} _Py_atomic_address;

typedef struct _Py_atomic_int {
    atomic_int _value;
} _Py_atomic_int;

... (rest same)
Date User Action Args
2015-03-16 13:55:35lbiancsetrecipients: + lbianc, vstinner, Arfrever, jrincayc, python-dev, Joshua.J.Cogliati,, gustavotemple
2015-03-16 13:55:35lbiancsetmessageid: <>
2015-03-16 13:55:34lbianclinkissue23644 messages
2015-03-16 13:55:34lbianccreate