mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-14 08:50:53 +08:00
22 lines
371 B
C++
22 lines
371 B
C++
|
#include "pch.h"
|
||
|
#include "FiberSleep.h"
|
||
|
|
||
|
CFiberSleep::CFiberSleep(void)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
CFiberSleep::~CFiberSleep(void)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void CFiberSleep::run(void)
|
||
|
{
|
||
|
printf("timer fiber-%d created\r\n", acl::fiber::self());
|
||
|
for (int i = 0; i < 5; i++) {
|
||
|
acl::fiber::delay(1000);
|
||
|
printf("fiber-%d wakeup\r\n", acl::fiber::self());
|
||
|
}
|
||
|
|
||
|
printf("sleep fiber exit now\r\n");
|
||
|
delete this;
|
||
|
}
|