about summary refs log tree commit diff
path: root/src/libstd/timer.rs
diff options
context:
space:
mode:
authorEric Holk <eric.holk@gmail.com>2012-05-22 14:10:32 -0700
committerEric Holk <eric.holk@gmail.com>2012-05-22 14:10:32 -0700
commit0b2f2cabbe3fbe6e18cbf0f8a174b7d4789fc938 (patch)
treece84fbb044a908ff5c98fd1fa0e6990159126177 /src/libstd/timer.rs
parentf213c1f3a817ba2c0a43c0b27215146b7a279f65 (diff)
downloadrust-0b2f2cabbe3fbe6e18cbf0f8a174b7d4789fc938.tar.gz
rust-0b2f2cabbe3fbe6e18cbf0f8a174b7d4789fc938.zip
Send is no longer a subkind of copy. This allows for sendable, but non-copyable resources. Closes #2420.
Diffstat (limited to 'src/libstd/timer.rs')
-rw-r--r--src/libstd/timer.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/timer.rs b/src/libstd/timer.rs
index 524accf6f1a..cf2c10aa998 100644
--- a/src/libstd/timer.rs
+++ b/src/libstd/timer.rs
@@ -20,7 +20,7 @@ for *at least* that period of time.
 * ch - a channel of type T to send a `val` on
 * val - a value of type T to send over the provided `ch`
 "]
-fn delayed_send<T: send>(msecs: uint, ch: comm::chan<T>, val: T) {
+fn delayed_send<T: copy send>(msecs: uint, ch: comm::chan<T>, val: T) {
     task::spawn() {||
         unsafe {
             let timer_done_po = comm::port::<()>();
@@ -94,7 +94,9 @@ An `option<T>` representing the outcome of the call. If the call `recv`'d on
 the provided port in the allotted timeout period, then the result will be a
 `some(T)`. If not, then `none` will be returned.
 "]
-fn recv_timeout<T: send>(msecs: uint, wait_po: comm::port<T>) -> option<T> {
+fn recv_timeout<T: copy send>(msecs: uint, wait_po: comm::port<T>)
+    -> option<T> {
+
     let timeout_po = comm::port::<()>();
     let timeout_ch = comm::chan(timeout_po);
     delayed_send(msecs, timeout_ch, ());