dca_interface  6.3.4
customdb_samples/customdbsample_extended/mythreads.h File Reference

Header file for functions related to start and stop the update and schedule threads. More...

Go to the source code of this file.

Functions

void StartupThreads (const dca::DcaInstance &aDcaInstance, const dca::UpdateModule &aUpdateModule, volatile bool *schedulerErrorSignal, volatile bool *performUpdateErrorSignal)
 Starts up the update and schedule threads and supplies the given DcaInstance and UpdateModule. More...
 
void ShutdownThreads ()
 Shuts down the previously started update and schedule threads. More...
 
void mySleep (unsigned int ms)
 sleeps the given interval (in milliseconds)
 

Detailed Description

Header file for functions related to start and stop the update and schedule threads.

Definition in file customdb_samples/customdbsample_extended/mythreads.h.

Function Documentation

◆ StartupThreads()

void StartupThreads ( const dca::DcaInstance aDcaInstance,
const dca::UpdateModule aUpdateModule,
volatile bool *  schedulerErrorSignal,
volatile bool *  performUpdateErrorSignal 
)

Starts up the update and schedule threads and supplies the given DcaInstance and UpdateModule.

Parameters
[in]aDcaInstanceAn initialized DcaInstance
[in]aUpdateModuleAn initialized UpdateModule
[out]schedulerErrorSignalIf an UpdateModule::performUpdate() call encounters an error this bool will be set to true, and the main application will shut down.
[out]performUpdateErrorSignalIf an DcaInstance::schedule() call encounters an error this bool will be set to true, and the main application will shut down.

Starts up two threads

  • an update thread that calls the aUpdateModule::performUpdate() method in a loop and
  • a schedule thread that calls the aDcaInstance::schedule() method in a loop.

The called functions will check engine and content updates automatically and install them in the provided dca/init directory.

They will be stopped by a call to ShutdownThreads()

See also
createPerformUpdateThread, createScheduleThread, ShutdownThreads

Definition at line 13 of file customdb_samples/customdbsample_extended/mythreads.cpp.

◆ ShutdownThreads()

void ShutdownThreads ( )

Shuts down the previously started update and schedule threads.

Shutting down will stop the threads safely.

If an update is already in progress the function will return as soon as possible but will not force-terminate any thread.

Note
To force stop any running update processes immediately a call to DcaInstance::signal() should be invoked.
See also
shutdownScheduleThread, shutdownPerformUpdateThread, StartupThreads

Definition at line 20 of file customdb_samples/customdbsample_extended/mythreads.cpp.