We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 450c4f3 commit 9f95ccbCopy full SHA for 9f95ccb
src/test/run-pass/crust-stress.rs
@@ -0,0 +1,28 @@
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 == 1u {
11
+ data
12
+ } else {
13
+ task::yield();
14
+ count(data - 1u) + count(data - 1u)
15
+ }
16
17
18
+fn count(n: uint) -> uint {
19
+ rustrt::rust_dbg_call(cb, n)
20
21
22
+fn main() {
23
+ iter::repeat(100u) {||
24
+ task::spawn {||
25
+ count(5u);
26
+ };
27
28
0 commit comments