File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 450c4f3fa84f1cc1fe85e2f74402e00a7557433b
2
+ refs/heads/master: 9f95ccb4269f2bb795c56d0fa7692cb7705c608e
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
5
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Original file line number Diff line number Diff line change
1
+ // This creates a bunch of yielding tasks that run concurrently
2
+ // while holding onto C stacks
3
+
4
+ native mod rustrt {
5
+ fn rust_dbg_call ( cb : * u8 ,
6
+ data : ctypes:: uintptr_t ) -> ctypes:: uintptr_t ;
7
+ }
8
+
9
+ crust fn cb ( data : ctypes:: uintptr_t ) -> ctypes:: uintptr_t {
10
+ if data == 1 u {
11
+ data
12
+ } else {
13
+ task:: yield ( ) ;
14
+ count ( data - 1 u) + count ( data - 1 u)
15
+ }
16
+ }
17
+
18
+ fn count ( n : uint ) -> uint {
19
+ rustrt:: rust_dbg_call ( cb, n)
20
+ }
21
+
22
+ fn main ( ) {
23
+ iter:: repeat ( 100 u) { ||
24
+ task:: spawn { ||
25
+ count ( 5 u) ;
26
+ } ;
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments