File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
branches/snap-stage3/src/libstd/rt Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 9ad199754923e6d0ce8a004087036bf5bd347fbf
4
+ refs/heads/snap-stage3: a093b5434a7110967d8597fb602588b299f9859e
5
5
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ pub fn spawntask_try(f: ~fn()) -> Result<(), ()> {
293
293
if exit_status { Ok ( ( ) ) } else { Err ( ( ) ) }
294
294
}
295
295
296
- // Spawn a new task in a new scheduler and return a thread handle.
296
+ /// Spawn a new task in a new scheduler and return a thread handle.
297
297
pub fn spawntask_thread( f: ~fn ( ) ) -> Thread {
298
298
use rt:: sched : : * ;
299
299
@@ -317,6 +317,16 @@ pub fn spawntask_thread(f: ~fn()) -> Thread {
317
317
return thread;
318
318
}
319
319
320
+ /// Get a ~Task for testing purposes other than actually scheduling it.
321
+ pub fn with_test_task( blk: ~fn ( ~Task ) -> ~Task ) {
322
+ do run_in_bare_thread {
323
+ let mut sched = ~new_test_uv_sched( ) ;
324
+ let task = blk( ~Task :: new_root( & mut sched. stack_pool, ||{ } ) ) ;
325
+ sched. enqueue_task( task) ;
326
+ sched. run( ) ;
327
+ }
328
+ }
329
+
320
330
321
331
/// Get a port number, starting at 9600, for use in tests
322
332
pub fn next_test_port( ) -> u16 {
You can’t perform that action at this time.
0 commit comments