@@ -173,49 +173,49 @@ mod imp {
173
173
type pthread_condattr_t = libc:: c_void ;
174
174
175
175
pub unsafe fn init_lock ( ) -> uint {
176
- let block = malloc_raw ( rust_pthread_mutex_t_size ( ) as uint ) as * pthread_mutex_t ;
176
+ let block = malloc_raw ( rust_pthread_mutex_t_size ( ) as uint ) as * mut pthread_mutex_t ;
177
177
let n = pthread_mutex_init ( block, ptr:: null ( ) ) ;
178
178
assert_eq ! ( n, 0 ) ;
179
179
return block as uint ;
180
180
}
181
181
182
182
pub unsafe fn init_cond ( ) -> uint {
183
- let block = malloc_raw ( rust_pthread_cond_t_size ( ) as uint ) as * pthread_cond_t ;
183
+ let block = malloc_raw ( rust_pthread_cond_t_size ( ) as uint ) as * mut pthread_cond_t ;
184
184
let n = pthread_cond_init ( block, ptr:: null ( ) ) ;
185
185
assert_eq ! ( n, 0 ) ;
186
186
return block as uint ;
187
187
}
188
188
189
189
pub unsafe fn free_lock ( h : uint ) {
190
- let block = h as * libc:: c_void ;
190
+ let block = h as * mut libc:: c_void ;
191
191
assert_eq ! ( pthread_mutex_destroy( block) , 0 ) ;
192
192
libc:: free ( block) ;
193
193
}
194
194
195
195
pub unsafe fn free_cond ( h : uint ) {
196
- let block = h as * pthread_cond_t ;
196
+ let block = h as * mut pthread_cond_t ;
197
197
assert_eq ! ( pthread_cond_destroy( block) , 0 ) ;
198
198
libc:: free ( block) ;
199
199
}
200
200
201
201
pub unsafe fn lock ( l : uint ) {
202
- assert_eq ! ( pthread_mutex_lock( l as * pthread_mutex_t) , 0 ) ;
202
+ assert_eq ! ( pthread_mutex_lock( l as * mut pthread_mutex_t) , 0 ) ;
203
203
}
204
204
205
205
pub unsafe fn trylock ( l : uint ) -> bool {
206
- pthread_mutex_trylock ( l as * pthread_mutex_t ) == 0
206
+ pthread_mutex_trylock ( l as * mut pthread_mutex_t ) == 0
207
207
}
208
208
209
209
pub unsafe fn unlock ( l : uint ) {
210
- assert_eq ! ( pthread_mutex_unlock( l as * pthread_mutex_t) , 0 ) ;
210
+ assert_eq ! ( pthread_mutex_unlock( l as * mut pthread_mutex_t) , 0 ) ;
211
211
}
212
212
213
213
pub unsafe fn wait ( cond : uint , m : uint ) {
214
- assert_eq ! ( pthread_cond_wait( cond as * pthread_cond_t, m as * pthread_mutex_t) , 0 ) ;
214
+ assert_eq ! ( pthread_cond_wait( cond as * mut pthread_cond_t, m as * mut pthread_mutex_t) , 0 ) ;
215
215
}
216
216
217
217
pub unsafe fn signal ( cond : uint ) {
218
- assert_eq ! ( pthread_cond_signal( cond as * pthread_cond_t) , 0 ) ;
218
+ assert_eq ! ( pthread_cond_signal( cond as * mut pthread_cond_t) , 0 ) ;
219
219
}
220
220
221
221
extern {
@@ -224,19 +224,19 @@ mod imp {
224
224
}
225
225
226
226
extern {
227
- fn pthread_mutex_init ( lock : * pthread_mutex_t ,
227
+ fn pthread_mutex_init ( lock : * mut pthread_mutex_t ,
228
228
attr : * pthread_mutexattr_t ) -> libc:: c_int ;
229
- fn pthread_mutex_destroy ( lock : * pthread_mutex_t ) -> libc:: c_int ;
230
- fn pthread_cond_init ( cond : * pthread_cond_t ,
229
+ fn pthread_mutex_destroy ( lock : * mut pthread_mutex_t ) -> libc:: c_int ;
230
+ fn pthread_cond_init ( cond : * mut pthread_cond_t ,
231
231
attr : * pthread_condattr_t ) -> libc:: c_int ;
232
- fn pthread_cond_destroy ( cond : * pthread_cond_t ) -> libc:: c_int ;
233
- fn pthread_mutex_lock ( lock : * pthread_mutex_t ) -> libc:: c_int ;
234
- fn pthread_mutex_trylock ( lock : * pthread_mutex_t ) -> libc:: c_int ;
235
- fn pthread_mutex_unlock ( lock : * pthread_mutex_t ) -> libc:: c_int ;
232
+ fn pthread_cond_destroy ( cond : * mut pthread_cond_t ) -> libc:: c_int ;
233
+ fn pthread_mutex_lock ( lock : * mut pthread_mutex_t ) -> libc:: c_int ;
234
+ fn pthread_mutex_trylock ( lock : * mut pthread_mutex_t ) -> libc:: c_int ;
235
+ fn pthread_mutex_unlock ( lock : * mut pthread_mutex_t ) -> libc:: c_int ;
236
236
237
- fn pthread_cond_wait ( cond : * pthread_cond_t ,
238
- lock : * pthread_mutex_t ) -> libc:: c_int ;
239
- fn pthread_cond_signal ( cond : * pthread_cond_t ) -> libc:: c_int ;
237
+ fn pthread_cond_wait ( cond : * mut pthread_cond_t ,
238
+ lock : * mut pthread_mutex_t ) -> libc:: c_int ;
239
+ fn pthread_cond_signal ( cond : * mut pthread_cond_t ) -> libc:: c_int ;
240
240
}
241
241
}
242
242
@@ -263,7 +263,7 @@ mod imp {
263
263
264
264
pub unsafe fn free_lock ( h : uint ) {
265
265
DeleteCriticalSection ( h as LPCRITICAL_SECTION ) ;
266
- libc:: free ( h as * c_void ) ;
266
+ libc:: free ( h as * mut c_void ) ;
267
267
}
268
268
269
269
pub unsafe fn free_cond ( h : uint ) {
0 commit comments