Skip to content
This repository was archived by the owner on Jul 6, 2019. It is now read-only.

Commit bbaa81d

Browse files
committed
Merge pull request #206 from farcaller/fix_nightly
Changed Unsafe -> UnsafeCell; removed Share
2 parents 568ecaa + 5a6f341 commit bbaa81d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/zinc/os/cond_var.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod internal {
2222
use core::option::{None, Some};
2323
use core::ty::Unsafe;
2424
use core::kinds::marker;
25-
use core::kinds::Share;
25+
use core::kinds::Sync;
2626

2727
use hal::cortex_m3::sched::NoInterrupts;
2828
use util::queue::{Queue, Node};
@@ -87,13 +87,13 @@ mod internal {
8787
}
8888
}
8989

90-
impl Share for CondVar {}
90+
impl Sync for CondVar {}
9191
}
9292

9393
#[cfg(not(multitasking))]
9494
mod internal {
9595
use core::kinds::marker;
96-
use core::kinds::Share;
96+
use core::kinds::Sync;
9797
use core::cell::UnsafeCell;
9898

9999
use util::support::wfi;
@@ -143,5 +143,5 @@ mod internal {
143143
}
144144
}
145145

146-
impl Share for CondVar {}
146+
impl Sync for CondVar {}
147147
}

src/zinc/os/mutex.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub use os::mutex::internal::{MUTEX_INIT, Mutex, Guard};
2121
mod internal {
2222
use core::kinds::marker;
2323
use core::ty::Unsafe;
24-
use core::kinds::{Share};
24+
use core::kinds::Sync;
2525
use core::option::{Option, None, Some};
2626
use core::ops::Drop;
2727

@@ -137,12 +137,12 @@ mod internal {
137137
}
138138
}
139139

140-
impl Share for Mutex { }
140+
impl Sync for Mutex { }
141141
}
142142

143143
#[cfg(not(multitasking))]
144144
mod internal {
145-
use core::kinds::{Share};
145+
use core::kinds::Sync;
146146
use core::option::{Option, None, Some};
147147
use core::ops::Drop;
148148
use core::intrinsics::abort;
@@ -202,5 +202,5 @@ mod internal {
202202
}
203203
}
204204

205-
impl Share for Mutex { }
205+
impl Sync for Mutex { }
206206
}

src/zinc/util/shared.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
//! Concurrency-friendly shared state
1717
18-
use core::ty::Unsafe;
18+
use core::cell::UnsafeCell;
1919
use core::ops::{Deref, DerefMut};
20-
use core::kinds::{Share, Send};
20+
use core::kinds::{Sync, Send};
2121
use core::kinds::marker;
2222

2323
use hal::cortex_m3::irq::NoInterrupts;
@@ -26,7 +26,7 @@ use hal::cortex_m3::irq::NoInterrupts;
2626
/// when in a critical section.
2727
#[allow(missing_doc)]
2828
pub struct Shared<T> {
29-
pub value: Unsafe<T>,
29+
pub value: UnsafeCell<T>,
3030
pub invariant: marker::InvariantType<T>,
3131
}
3232

@@ -41,7 +41,7 @@ impl<T> Shared<T> {
4141
/// Create a new `Shared` value
4242
pub fn new(value: T) -> Shared<T> {
4343
Shared {
44-
value: Unsafe::new(value),
44+
value: UnsafeCell::new(value),
4545
invariant: marker::InvariantType,
4646
}
4747
}
@@ -68,4 +68,4 @@ impl<'a, T> DerefMut<T> for SharedRef<'a, T> {
6868
}
6969
}
7070

71-
impl<T: Send> Share for Shared<T> {}
71+
impl<T: Send> Sync for Shared<T> {}

0 commit comments

Comments
 (0)