diff options
Diffstat (limited to 'src/components/util/task.rs')
-rw-r--r-- | src/components/util/task.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/components/util/task.rs b/src/components/util/task.rs new file mode 100644 index 00000000000..20dc2b6ad6f --- /dev/null +++ b/src/components/util/task.rs @@ -0,0 +1,11 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use std::task; + +pub fn spawn_named<S: IntoSendStr>(name: S, f: proc()) { + let mut builder = task::task(); + builder.name(name); + builder.spawn(f); +} |