Skip to content

Commit db5fd80

Browse files
committed
---
yaml --- r: 30024 b: refs/heads/incoming c: c47342e h: refs/heads/master v: v3
1 parent 9c8cd4f commit db5fd80

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: dc107898b2524aef8854483480df7fcca7a7e7ce
9+
refs/heads/incoming: c47342e7c2271c32651725b0f026fb24822eb828
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/pipes.rs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -243,39 +243,37 @@ fn entangle_buffer<T: send, Tstart: send>(
243243
#[abi = "rust-intrinsic"]
244244
#[doc(hidden)]
245245
extern mod rusti {
246-
fn atomic_xchng(&dst: int, src: int) -> int;
247-
fn atomic_xchng_acq(&dst: int, src: int) -> int;
248-
fn atomic_xchng_rel(&dst: int, src: int) -> int;
246+
fn atomic_xchg(dst: &mut int, src: int) -> int;
247+
fn atomic_xchg_acq(dst: &mut int, src: int) -> int;
248+
fn atomic_xchg_rel(dst: &mut int, src: int) -> int;
249249

250-
fn atomic_add_acq(&dst: int, src: int) -> int;
251-
fn atomic_sub_rel(&dst: int, src: int) -> int;
250+
fn atomic_xadd_acq(dst: &mut int, src: int) -> int;
251+
fn atomic_xsub_rel(dst: &mut int, src: int) -> int;
252252
}
253253

254254
// If I call the rusti versions directly from a polymorphic function,
255255
// I get link errors. This is a bug that needs investigated more.
256256
#[doc(hidden)]
257257
fn atomic_xchng_rel(dst: &mut int, src: int) -> int {
258-
rusti::atomic_xchng_rel(*dst, src)
258+
rusti::atomic_xchg_rel(dst, src)
259259
}
260260

261261
#[doc(hidden)]
262262
fn atomic_add_acq(dst: &mut int, src: int) -> int {
263-
rusti::atomic_add_acq(*dst, src)
263+
rusti::atomic_xadd_acq(dst, src)
264264
}
265265

266266
#[doc(hidden)]
267267
fn atomic_sub_rel(dst: &mut int, src: int) -> int {
268-
rusti::atomic_sub_rel(*dst, src)
268+
rusti::atomic_xsub_rel(dst, src)
269269
}
270270

271271
#[doc(hidden)]
272-
fn swap_task(dst: &mut *rust_task, src: *rust_task) -> *rust_task {
272+
fn swap_task(+dst: &mut *rust_task, src: *rust_task) -> *rust_task {
273273
// It might be worth making both acquire and release versions of
274274
// this.
275275
unsafe {
276-
reinterpret_cast(rusti::atomic_xchng(
277-
*(ptr::mut_addr_of(*dst) as *mut int),
278-
src as int))
276+
transmute(rusti::atomic_xchg(transmute(dst), src as int))
279277
}
280278
}
281279

@@ -309,20 +307,16 @@ fn wait_event(this: *rust_task) -> *libc::c_void {
309307
}
310308

311309
#[doc(hidden)]
312-
fn swap_state_acq(dst: &mut state, src: state) -> state {
310+
fn swap_state_acq(+dst: &mut state, src: state) -> state {
313311
unsafe {
314-
reinterpret_cast(rusti::atomic_xchng_acq(
315-
*(ptr::mut_addr_of(*dst) as *mut int),
316-
src as int))
312+
transmute(rusti::atomic_xchg_acq(transmute(dst), src as int))
317313
}
318314
}
319315

320316
#[doc(hidden)]
321-
fn swap_state_rel(dst: &mut state, src: state) -> state {
317+
fn swap_state_rel(+dst: &mut state, src: state) -> state {
322318
unsafe {
323-
reinterpret_cast(rusti::atomic_xchng_rel(
324-
*(ptr::mut_addr_of(*dst) as *mut int),
325-
src as int))
319+
transmute(rusti::atomic_xchg_rel(transmute(dst), src as int))
326320
}
327321
}
328322

0 commit comments

Comments
 (0)