mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-07 12:08:15 +01:00
samples: Update helloworld_std_thread.
This commit is contained in:
parent
b4a6eb2f78
commit
4891278425
@ -12,7 +12,9 @@ target_link_libraries(helloworld_std_thread
|
|||||||
proc_ui
|
proc_ui
|
||||||
sysapp)
|
sysapp)
|
||||||
|
|
||||||
|
wut_enable_newlib(helloworld_std_thread)
|
||||||
wut_enable_stdcpp(helloworld_std_thread)
|
wut_enable_stdcpp(helloworld_std_thread)
|
||||||
|
|
||||||
wut_create_rpx(helloworld_std_thread.rpx helloworld_std_thread)
|
wut_create_rpx(helloworld_std_thread.rpx helloworld_std_thread)
|
||||||
|
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/helloworld_std_thread.rpx"
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/helloworld_std_thread.rpx"
|
||||||
|
@ -11,13 +11,10 @@
|
|||||||
int
|
int
|
||||||
hello_thread()
|
hello_thread()
|
||||||
{
|
{
|
||||||
OSCalendarTime tm;
|
|
||||||
|
|
||||||
WHBProcInit();
|
|
||||||
WHBLogConsoleInit();
|
|
||||||
WHBLogPrintf("Hello World from a std::thread!");
|
WHBLogPrintf("Hello World from a std::thread!");
|
||||||
|
|
||||||
while(WHBProcIsRunning()) {
|
while(WHBProcIsRunning()) {
|
||||||
|
OSCalendarTime tm;
|
||||||
OSTicksToCalendarTime(OSGetTime(), &tm);
|
OSTicksToCalendarTime(OSGetTime(), &tm);
|
||||||
WHBLogPrintf("%02d/%02d/%04d %02d:%02d:%02d I'm still here.",
|
WHBLogPrintf("%02d/%02d/%04d %02d:%02d:%02d I'm still here.",
|
||||||
tm.tm_mday, tm.tm_mon, tm.tm_year,
|
tm.tm_mday, tm.tm_mon, tm.tm_year,
|
||||||
@ -30,16 +27,19 @@ hello_thread()
|
|||||||
WHBLogPrintf("Exiting... good bye.");
|
WHBLogPrintf("Exiting... good bye.");
|
||||||
WHBLogConsoleDraw();
|
WHBLogConsoleDraw();
|
||||||
OSSleepTicks(OSMilliseconds(1000));
|
OSSleepTicks(OSMilliseconds(1000));
|
||||||
|
|
||||||
WHBLogConsoleFree();
|
|
||||||
WHBProcShutdown();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
WHBProcInit();
|
||||||
|
WHBLogConsoleInit();
|
||||||
|
|
||||||
std::thread t(hello_thread);
|
std::thread t(hello_thread);
|
||||||
t.join();
|
t.join();
|
||||||
|
|
||||||
|
WHBLogConsoleFree();
|
||||||
|
WHBProcShutdown();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user