void CoreInit::initialise() { initialiseAlarm(); initialiseDynLoad(); initialiseEvent(); initialiseGHS(); initialiseMembase(); initialiseMessageQueues(); initialiseSchedulerFunctions(); initialiseShared(); initialiseSystemInformation(); initialiseThread(); }
void ThreadController::run_resetPlayer(){ initialiseThread(); //Initialise the thread, if it doesn't exist yet lock.lock(); assert(!commandAvailable); //we can't send a new command, if there is still a command in the queue assert(!resultAvailable); //we can't send a new command, if the result from the old one hasn't been read yet. command = { ThreadCommand::RESET_PLAYER, nullptr, nullptr }; #if THREAD_DEBUGGING std::cout << "Sending new command to thread: " << command.toString() << std::endl; #endif commandAvailable = true; lock.unlock(); cv.notify_one(); }
void ThreadController::run_selectMeeplePosition(const GameState& gameState, const Meeple& meepleToSet){ initialiseThread(); //Initialise the thread, if it doesn't exist yet lock.lock(); assert(!commandAvailable); //we can't send a new command, if there is still a command in the queue assert(!resultAvailable); //we can't send a new command, if the result from the old one hasn't been read yet. command = { ThreadCommand::SELECT_MEEPLE_POSITION, &gameState, &meepleToSet }; #if THREAD_DEBUGGING std::cout << "Sending new command to thread: " << command.toString() << std::endl; #endif commandAvailable = true; lock.unlock(); cv.notify_one(); //notify the thread (the cv.wait() will wake up the thread }