@@ -33,7 +33,7 @@ impl Mutex {
33
33
#[ inline]
34
34
unsafe fn atomic_init ( & self ) {
35
35
loop {
36
- match self . initialized . compare_exchange_weak ( UNINITIALIZED , INITIALIZING , SeqCst , SeqCst ) {
36
+ match self . initialized . compare_exchange ( UNINITIALIZED , INITIALIZING , SeqCst , SeqCst ) {
37
37
Ok ( UNINITIALIZED ) => {
38
38
* self . inner . get ( ) = xSemaphoreCreateMutex ( ) ;
39
39
debug_assert ! ( !( * self . inner. get( ) ) . is_null( ) ) ;
@@ -69,7 +69,7 @@ impl Mutex {
69
69
#[ inline]
70
70
pub unsafe fn destroy ( & self ) {
71
71
loop {
72
- match self . initialized . compare_exchange_weak ( INITIALIZED , UNINITIALIZING , SeqCst , SeqCst ) {
72
+ match self . initialized . compare_exchange ( INITIALIZED , UNINITIALIZING , SeqCst , SeqCst ) {
73
73
Ok ( INITIALIZED ) => {
74
74
vSemaphoreDelete ( * self . inner . get ( ) ) ;
75
75
* self . inner . get ( ) = ptr:: null_mut ( ) ;
@@ -113,7 +113,7 @@ impl ReentrantMutex {
113
113
#[ inline]
114
114
unsafe fn atomic_init ( & self ) {
115
115
loop {
116
- match self . initialized . compare_exchange_weak ( UNINITIALIZED , INITIALIZING , SeqCst , SeqCst ) {
116
+ match self . initialized . compare_exchange ( UNINITIALIZED , INITIALIZING , SeqCst , SeqCst ) {
117
117
Ok ( UNINITIALIZED ) => {
118
118
* self . inner . get ( ) = xSemaphoreCreateRecursiveMutex ( ) ;
119
119
debug_assert ! ( !( * self . inner. get( ) ) . is_null( ) ) ;
@@ -147,7 +147,7 @@ impl ReentrantMutex {
147
147
148
148
pub unsafe fn destroy ( & self ) {
149
149
loop {
150
- match self . initialized . compare_exchange_weak ( INITIALIZED , UNINITIALIZING , SeqCst , SeqCst ) {
150
+ match self . initialized . compare_exchange ( INITIALIZED , UNINITIALIZING , SeqCst , SeqCst ) {
151
151
Ok ( INITIALIZED ) => {
152
152
vSemaphoreDelete ( * self . inner . get ( ) ) ;
153
153
* self . inner . get ( ) = ptr:: null_mut ( ) ;
0 commit comments