auto merge of #13457 : alexcrichton/rust/issue-13420, r=thestinger
On some OSes (such as freebsd), pthread_attr_init allocates memory, so this is necessary to deallocate that memory. Closes #13420
This commit is contained in:
commit
1b37afe8a2
@ -245,6 +245,7 @@ mod imp {
|
|||||||
let arg: *libc::c_void = cast::transmute(p);
|
let arg: *libc::c_void = cast::transmute(p);
|
||||||
assert_eq!(pthread_create(&mut native, &attr,
|
assert_eq!(pthread_create(&mut native, &attr,
|
||||||
super::thread_start, arg), 0);
|
super::thread_start, arg), 0);
|
||||||
|
assert_eq!(pthread_attr_destroy(&mut attr), 0);
|
||||||
native
|
native
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,6 +304,7 @@ mod imp {
|
|||||||
fn pthread_join(native: libc::pthread_t,
|
fn pthread_join(native: libc::pthread_t,
|
||||||
value: **libc::c_void) -> libc::c_int;
|
value: **libc::c_void) -> libc::c_int;
|
||||||
fn pthread_attr_init(attr: *mut libc::pthread_attr_t) -> libc::c_int;
|
fn pthread_attr_init(attr: *mut libc::pthread_attr_t) -> libc::c_int;
|
||||||
|
fn pthread_attr_destroy(attr: *mut libc::pthread_attr_t) -> libc::c_int;
|
||||||
fn pthread_attr_setstacksize(attr: *mut libc::pthread_attr_t,
|
fn pthread_attr_setstacksize(attr: *mut libc::pthread_attr_t,
|
||||||
stack_size: libc::size_t) -> libc::c_int;
|
stack_size: libc::size_t) -> libc::c_int;
|
||||||
fn pthread_attr_setdetachstate(attr: *mut libc::pthread_attr_t,
|
fn pthread_attr_setdetachstate(attr: *mut libc::pthread_attr_t,
|
||||||
|
Loading…
Reference in New Issue
Block a user