File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -78,12 +78,20 @@ use intrinsics;
78
78
use cell:: UnsafeCell ;
79
79
use marker:: PhantomData ;
80
80
81
+ use default:: Default ;
82
+
81
83
/// A boolean type which can be safely shared between threads.
82
84
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
83
85
pub struct AtomicBool {
84
86
v : UnsafeCell < usize > ,
85
87
}
86
88
89
+ impl Default for AtomicBool {
90
+ fn default ( ) -> AtomicBool {
91
+ ATOMIC_BOOL_INIT
92
+ }
93
+ }
94
+
87
95
unsafe impl Sync for AtomicBool { }
88
96
89
97
/// A signed integer type which can be safely shared between threads.
@@ -92,6 +100,12 @@ pub struct AtomicIsize {
92
100
v : UnsafeCell < isize > ,
93
101
}
94
102
103
+ impl Default for AtomicIsize {
104
+ fn default ( ) -> AtomicIsize {
105
+ ATOMIC_ISIZE_INIT
106
+ }
107
+ }
108
+
95
109
unsafe impl Sync for AtomicIsize { }
96
110
97
111
/// An unsigned integer type which can be safely shared between threads.
@@ -100,6 +114,12 @@ pub struct AtomicUsize {
100
114
v : UnsafeCell < usize > ,
101
115
}
102
116
117
+ impl Default for AtomicUsize {
118
+ fn default ( ) -> AtomicUsize {
119
+ ATOMIC_USIZE_INIT
120
+ }
121
+ }
122
+
103
123
unsafe impl Sync for AtomicUsize { }
104
124
105
125
/// A raw pointer type which can be safely shared between threads.
You can’t perform that action at this time.
0 commit comments