Skip to content

Commit a2c9cff

Browse files
zhengshuxinzhengshuxin
authored andcommitted
j#
1 parent b9a776e commit a2c9cff

File tree

2 files changed

+12
-43
lines changed

2 files changed

+12
-43
lines changed

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
all:
2+
@(cd c; make)
3+
@(cd c++; make)
4+
@(cd c++1x; make)
5+
6+
clean cl:
7+
@(cd c; make clean)
8+
@(cd c++; make clean)
9+
@(cd c++1x; make clean)
10+
11+
rebuild rb: cl all
12+

c++/fiber/fiber_demo.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,6 @@ class myfiber : public acl::fiber {
1414
}
1515
};
1616

17-
#ifdef ACL_USE_CPP11
18-
static void fiber1(void) {
19-
printf("in fiber: %d\r\n", acl::fiber::self());
20-
}
21-
22-
static void fiber2(int n, const char* s) {
23-
printf("in fiber: %d, n: %d, s: %s\r\n", acl::fiber::self(), n, s);
24-
}
25-
26-
static void fiber3(acl::string& buf) {
27-
printf("in fiber: %d, buf: %s\r\n", acl::fiber::self(), buf.c_str());
28-
buf = "world";
29-
}
30-
31-
static void fiber4(const acl::string& buf) {
32-
printf("in fiber: %d, buf: %s\r\n", acl::fiber::self(), buf.c_str());
33-
}
34-
35-
#endif
36-
3717
int main(void) {
3818
int n = 10;
3919

@@ -45,29 +25,6 @@ int main(void) {
4525
f->start();
4626
}
4727

48-
#ifdef ACL_USE_CPP11
49-
go fiber1;
50-
51-
go[=] {
52-
fiber2(n, "hello world");
53-
};
54-
55-
acl::string buf("hello");
56-
57-
go[&] {
58-
fiber3(buf);
59-
};
60-
61-
go[&] {
62-
fiber4(buf);
63-
};
64-
65-
go[=] {
66-
fiber4(buf);
67-
};
68-
#endif
69-
7028
acl::fiber::schedule();
71-
7229
return 0;
7330
}

0 commit comments

Comments
 (0)