mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
22 lines
323 B
C++
22 lines
323 B
C++
#include <Core/Core.h>
|
|
|
|
using namespace Upp;
|
|
|
|
CONSOLE_APP_MAIN
|
|
{
|
|
StdLogSetup(LOG_COUT|LOG_FILE);
|
|
|
|
CoWork co;
|
|
for(int i = 0; i < 50; i++)
|
|
co & [] {
|
|
for(;;) {
|
|
if(CoWork::IsCanceled()) {
|
|
LOG("CoWork was canceled");
|
|
return;
|
|
}
|
|
Sleep(1);
|
|
}
|
|
};
|
|
Sleep(100);
|
|
co.Cancel();
|
|
}
|