dca_interface  6.3.4
url_samples/urldbsample_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, dca::ScheduleEventSubscriberIntf *pSubscriber)
 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 url_samples/urldbsample_extended/mythreads.h.

Function Documentation

◆ StartupThreads()

void StartupThreads ( const dca::DcaInstance aDcaInstance,
const dca::UpdateModule aUpdateModule,
dca::ScheduleEventSubscriberIntf pSubscriber 
)

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

Parameters
[in]aDcaInstanceAn initialized DcaInstance
[in]aUpdateModuleAn initialized UpdateModule
[in]pSubscriberA pointer to an implementation of dca::ScheduleEventSubscriberIntf

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.

Schedule event information will be captured and handled by pSubscriber.

They will be stopped by a call to ShutdownThreads()

See also
createPerformUpdateThread, createScheduleThread, ShutdownThreads

Definition at line 13 of file url_samples/urldbsample_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 any running update processes to stop immediately a call to DcaInstance::signal() should be invoked.
See also
shutdownScheduleThread, shutdownPerformUpdateThread, StartupThreads

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.