#include "Threadux/Interlocked.h" #include "Threadux/Gate.h" #include "Threadux/Intercaller.h" #include "Threadux/Mutex.h" #include #include #include using namespace Threadux; struct Functor { void operator ()() {} void operator ()(int) {} void operator ()(int, int) {} }; void test() { Interlocked MyInt; MyInt = 12; ++MyInt; int i = MyInt++; --MyInt; int j = MyInt--; } int main() { try { test(); Interlocked MyBool; bool RealBool; MyBool = true; //12.34f; RealBool = true; Gate MyGate; MyGate.open(); MyGate.pass(1000); bool my = MyBool; bool real = RealBool; IntercallServer S; S.enqueue(Invocation::ofFunction(test)); S.flush(); Invocation MyTest = Invocation::ofMethod(S, &IntercallServer::flush); MyTest(); Invocation OtherTest = Invocation::ofFunctor(std::auto_ptr(new Functor), 1, 2); float mybool = MyBool; Mutex MyMutex; { Mutex::ScopedUser Me(MyMutex, 1000); { Mutex::ScopedUser Me(MyMutex, 1000); } } } catch(const std::exception &e) { std::cerr << e.what() << std::endl; } return 0; }