Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The c++ examples Tesh files.
[simgrid.git] / examples / cxx / suspend / LazyGuy.cxx
1 #include "LazyGuy.hpp"\r
2 #include <Host.hpp>\r
3 \r
4 #include <Msg.hpp>\r
5 \r
6 MSG_IMPLEMENT_DYNAMIC(LazyGuy, Process);\r
7 \r
8 int LazyGuy::main(int argc, char** argv)\r
9 {\r
10         info("Hello !");\r
11         \r
12         info("Nobody's watching me ? Let's go to sleep.");\r
13         \r
14         Process::currentProcess().suspend();\r
15         \r
16         info("Uuuh ? Did somebody call me ?");\r
17         \r
18         info("Mmmh, goodbye now."); \r
19 \r
20 \r
21         delete this;\r
22 \r
23         return 0;\r
24 }