core: Camel case some lesser-used modules
This commit is contained in:
parent
6b43c0c1ad
commit
5394e34aa4
40 changed files with 187 additions and 169 deletions
|
|
@ -3,7 +3,8 @@
|
|||
* between tasks.
|
||||
*/
|
||||
|
||||
import unsafe::{shared_mutable_state, clone_shared_mutable_state,
|
||||
import unsafe::{SharedMutableState,
|
||||
shared_mutable_state, clone_shared_mutable_state,
|
||||
get_shared_mutable_state, get_shared_immutable_state};
|
||||
import sync;
|
||||
import sync::{mutex, rwlock};
|
||||
|
|
@ -39,7 +40,7 @@ impl &condvar {
|
|||
****************************************************************************/
|
||||
|
||||
/// An atomically reference counted wrapper for shared immutable state.
|
||||
struct arc<T: const send> { x: shared_mutable_state<T>; }
|
||||
struct arc<T: const send> { x: SharedMutableState<T>; }
|
||||
|
||||
/// Create an atomically reference counted wrapper.
|
||||
fn arc<T: const send>(+data: T) -> arc<T> {
|
||||
|
|
@ -71,7 +72,7 @@ fn clone<T: const send>(rc: &arc<T>) -> arc<T> {
|
|||
|
||||
struct mutex_arc_inner<T: send> { lock: mutex; failed: bool; data: T; }
|
||||
/// An ARC with mutable data protected by a blocking mutex.
|
||||
struct mutex_arc<T: send> { x: shared_mutable_state<mutex_arc_inner<T>>; }
|
||||
struct mutex_arc<T: send> { x: SharedMutableState<mutex_arc_inner<T>>; }
|
||||
|
||||
/// Create a mutex-protected ARC with the supplied data.
|
||||
fn mutex_arc<T: send>(+user_data: T) -> mutex_arc<T> {
|
||||
|
|
@ -176,7 +177,7 @@ struct rw_arc_inner<T: const send> { lock: rwlock; failed: bool; data: T; }
|
|||
* Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested.
|
||||
*/
|
||||
struct rw_arc<T: const send> {
|
||||
x: shared_mutable_state<rw_arc_inner<T>>;
|
||||
x: SharedMutableState<rw_arc_inner<T>>;
|
||||
mut cant_nest: ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ export breakpoint;
|
|||
|
||||
#[abi = "cdecl"]
|
||||
extern mod rustrt {
|
||||
fn debug_tydesc(td: *sys::type_desc);
|
||||
fn debug_opaque(td: *sys::type_desc, x: *());
|
||||
fn debug_box(td: *sys::type_desc, x: *());
|
||||
fn debug_tag(td: *sys::type_desc, x: *());
|
||||
fn debug_fn(td: *sys::type_desc, x: *());
|
||||
fn debug_ptrcast(td: *sys::type_desc, x: *()) -> *();
|
||||
fn debug_tydesc(td: *sys::TypeDesc);
|
||||
fn debug_opaque(td: *sys::TypeDesc, x: *());
|
||||
fn debug_box(td: *sys::TypeDesc, x: *());
|
||||
fn debug_tag(td: *sys::TypeDesc, x: *());
|
||||
fn debug_fn(td: *sys::TypeDesc, x: *());
|
||||
fn debug_ptrcast(td: *sys::TypeDesc, x: *()) -> *();
|
||||
fn rust_dbg_breakpoint();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -622,11 +622,11 @@ impl <A: to_json> option<A>: to_json {
|
|||
}
|
||||
}
|
||||
|
||||
impl json: to_str::to_str {
|
||||
impl json: to_str::ToStr {
|
||||
fn to_str() -> ~str { to_str(self) }
|
||||
}
|
||||
|
||||
impl error: to_str::to_str {
|
||||
impl error: to_str::ToStr {
|
||||
fn to_str() -> ~str {
|
||||
fmt!{"%u:%u: %s", self.line, self.col, *self.msg}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#[warn(deprecated_mode)];
|
||||
|
||||
import io::writer_util;
|
||||
import to_str::to_str;
|
||||
import to_str::ToStr;
|
||||
export hashmap, hashfn, eqfn, set, map, chained, hashmap, str_hash;
|
||||
export box_str_hash;
|
||||
export bytes_hash, int_hash, uint_hash, set_add;
|
||||
|
|
@ -327,7 +327,7 @@ mod chained {
|
|||
}
|
||||
}
|
||||
|
||||
impl<K: copy to_str, V: to_str copy> t<K, V>: to_str {
|
||||
impl<K: copy ToStr, V: ToStr copy> t<K, V>: ToStr {
|
||||
fn to_writer(wr: io::writer) {
|
||||
if self.count == 0u {
|
||||
wr.write_str(~"{}");
|
||||
|
|
|
|||
|
|
@ -673,7 +673,7 @@ fn to_str(url: url) -> ~str {
|
|||
fragment]);
|
||||
}
|
||||
|
||||
impl url: to_str::to_str {
|
||||
impl url: to_str::ToStr {
|
||||
fn to_str() -> ~str {
|
||||
to_str(self)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
//! Sorting methods
|
||||
import vec::{len, push};
|
||||
import core::cmp::{eq, ord};
|
||||
import core::cmp::{Eq, Ord};
|
||||
|
||||
export le;
|
||||
export merge_sort;
|
||||
|
|
@ -153,7 +153,7 @@ fn qsort3<T: copy>(compare_func_lt: le<T>, compare_func_eq: le<T>,
|
|||
*
|
||||
* This is an unstable sort.
|
||||
*/
|
||||
fn quick_sort3<T: copy ord eq>(arr: ~[mut T]) {
|
||||
fn quick_sort3<T: copy Ord Eq>(arr: ~[mut T]) {
|
||||
if arr.len() <= 1 { return; }
|
||||
qsort3(core::cmp::lt, core::cmp::eq, arr, 0, (arr.len() - 1) as int);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
export condvar, semaphore, mutex, rwlock;
|
||||
|
||||
// FIXME (#3119) This shouldn't be a thing exported from core.
|
||||
import unsafe::exclusive;
|
||||
import unsafe::{Exclusive, exclusive};
|
||||
|
||||
/****************************************************************************
|
||||
* Internals
|
||||
|
|
@ -55,7 +55,7 @@ struct sem_inner<Q> {
|
|||
// a condition variable attached, others should.
|
||||
blocked: Q;
|
||||
}
|
||||
enum sem<Q: send> = exclusive<sem_inner<Q>>;
|
||||
enum sem<Q: send> = Exclusive<sem_inner<Q>>;
|
||||
|
||||
fn new_sem<Q: send>(count: int, +q: Q) -> sem<Q> {
|
||||
let (wait_tail, wait_head) = pipes::stream();
|
||||
|
|
@ -293,7 +293,7 @@ struct rwlock_inner {
|
|||
struct rwlock {
|
||||
/* priv */ order_lock: semaphore;
|
||||
/* priv */ access_lock: sem<waitqueue>;
|
||||
/* priv */ state: exclusive<rwlock_inner>;
|
||||
/* priv */ state: Exclusive<rwlock_inner>;
|
||||
}
|
||||
|
||||
/// Create a new rwlock.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue