mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
39 lines
470 B
C++
39 lines
470 B
C++
#include <Core/Core.h>
|
|
#include <iostream>
|
|
|
|
using namespace Upp;
|
|
|
|
class test
|
|
{
|
|
public:
|
|
typedef test CLASSNAME;
|
|
void loop();
|
|
void start();
|
|
};
|
|
|
|
void test::start()
|
|
{
|
|
Thread().Start(THISBACK(loop));
|
|
}
|
|
|
|
void test::loop()
|
|
{
|
|
std::string str;
|
|
while(true)
|
|
{
|
|
Thread().Sleep(200);
|
|
str.append("test");
|
|
std::cout << "loop" << std::endl;
|
|
}
|
|
}
|
|
|
|
CONSOLE_APP_MAIN
|
|
{
|
|
(new test)->start();
|
|
|
|
while(true)
|
|
{
|
|
Thread().Sleep(500);
|
|
std::cout << "Wait..." << std::endl;
|
|
}
|
|
}
|