Skip to content

Commit 1556845

Browse files
authored
Merge pull request #3619 from PyO3/portable-atomic
Use portable-atomic for targets which lack 64-bit atomics used to check interpreter ID.
2 parents 81ad2e8 + e6457c5 commit 1556845

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ cfg-if = "1.0"
1919
libc = "0.2.62"
2020
parking_lot = ">= 0.11, < 0.13"
2121
memoffset = "0.9"
22+
portable-atomic = "1.0"
2223

2324
# ffi bindings to the python interpreter, split into a separate crate so they can be used independently
2425
pyo3-ffi = { path = "pyo3-ffi", version = "=0.21.0-dev" }

newsfragments/3619.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use portable-atomic to support platforms without 64-bit atomics

src/impl_/pymodule.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::cell::UnsafeCell;
44

55
#[cfg(all(not(PyPy), Py_3_9, not(all(windows, Py_LIMITED_API, not(Py_3_10)))))]
6-
use std::sync::atomic::{AtomicI64, Ordering};
6+
use portable_atomic::{AtomicI64, Ordering};
77

88
#[cfg(not(PyPy))]
99
use crate::exceptions::PyImportError;

0 commit comments

Comments
 (0)