deactive profiler when not in use; use newtype structs for task chans

This commit is contained in:
Tim Kuehn 2013-09-19 21:29:23 -04:00
parent 17864cb25d
commit c804db0f93
7 changed files with 55 additions and 92 deletions

View file

@ -83,20 +83,11 @@ pub struct NewLayoutInfo {
/// Encapsulates external communication with the script task.
#[deriving(Clone)]
pub struct ScriptChan {
/// The channel used to send messages to the script task.
chan: SharedChan<ScriptMsg>,
}
pub struct ScriptChan(SharedChan<ScriptMsg>);
impl ScriptChan {
/// Creates a new script chan.
pub fn new(chan: Chan<ScriptMsg>) -> ScriptChan {
ScriptChan {
chan: SharedChan::new(chan)
}
}
pub fn send(&self, msg: ScriptMsg) {
self.chan.send(msg);
ScriptChan(SharedChan::new(chan))
}
}