File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,13 @@ pub struct Condvar {
2828unsafe impl Send for Condvar { }
2929unsafe impl Sync for Condvar { }
3030
31+ const NEW : Condvar = Condvar {
32+ condvar : UnsafeCell :: new ( AtomicU32 :: new ( abi:: CONDVAR_HAS_NO_WAITERS . 0 ) ) ,
33+ } ;
34+
3135impl Condvar {
3236 pub const fn new ( ) -> Condvar {
33- Condvar {
34- condvar : UnsafeCell :: new ( AtomicU32 :: new ( abi:: CONDVAR_HAS_NO_WAITERS . 0 ) ) ,
35- }
37+ NEW
3638 }
3739
3840 pub unsafe fn init ( & mut self ) { }
Original file line number Diff line number Diff line change @@ -32,11 +32,13 @@ pub unsafe fn raw(r: &RWLock) -> *mut AtomicU32 {
3232unsafe impl Send for RWLock { }
3333unsafe impl Sync for RWLock { }
3434
35+ const NEW : RWLock = RWLock {
36+ lock : UnsafeCell :: new ( AtomicU32 :: new ( abi:: LOCK_UNLOCKED . 0 ) ) ,
37+ } ;
38+
3539impl RWLock {
3640 pub const fn new ( ) -> RWLock {
37- RWLock {
38- lock : UnsafeCell :: new ( AtomicU32 :: new ( abi:: LOCK_UNLOCKED . 0 ) ) ,
39- }
41+ NEW
4042 }
4143
4244 pub unsafe fn try_read ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments