Last active
September 2, 2015 03:38
-
-
Save SammyJames/d9a4045ec1c8820d1e15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015 Sammy James | |
#include "TaskTypes.h" | |
#include "Jobs/Job.h" | |
#include "Fibers/Fiber.h" | |
#include "Threads/Thread.h" | |
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <assert.h> | |
int32 main( int32 ArgC, char** ArgV ) | |
{ | |
Threads::Thread TestThread( "Test Thread", true ); | |
TestThread.SetPriority( Threads::EPriority::Normal ); | |
std::shared_ptr< Jobs::IJob > NewJob( new Jobs::Job< int32 >( | |
[]( int32 Test ) | |
{ | |
printf( "Testing: %d", Test ); | |
}, | |
INT_MAX ) ); | |
std::shared_ptr< Jobs::IJob > SecondJob( new Jobs::Job< std::string >( | |
[]( const std::string& Arg ) | |
{ | |
printf( "Testing: %s", Arg.c_str() ); | |
}, | |
"Hello World" ) ); | |
TestThread.AddJob( NewJob ); | |
TestThread.AddJob( SecondJob ); | |
TestThread.WaitForCompletion(); | |
TestThread.RequestJoin(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment