dca_interface  6.3.4
url_samples/urldbsample_extended/linux/schedule_thread.cpp File Reference

Implementation of the schedule thread. More...

#include "dca/dca_base.h"
#include "../mythreads.h"
#include <sys/time.h>
#include <fcntl.h>
#include <cerrno>

Go to the source code of this file.

Functions

static void * ScheduleThreadWorkerFunction (void *pThreadData)
 
void createScheduleThread (const DcaInstance &aDcaInstance, ScheduleEventSubscriberIntf *pSubscriber)
 Starts up the schedule thread and supplies the given DcaInstance. More...
 
void shutdownScheduleThread ()
 Shuts down the previously started schedule thread. More...
 

Variables

static ScheduleThreadData S_scheduleThreadData
 
static pthread_t S_hScheduleThread = 0
 

Detailed Description

Implementation of the schedule thread.

Definition in file url_samples/urldbsample_extended/linux/schedule_thread.cpp.

Function Documentation

◆ createScheduleThread()

void createScheduleThread ( const dca::DcaInstance aDcaInstance,
dca::ScheduleEventSubscriberIntf pSubscriber 
)

Starts up the schedule thread and supplies the given DcaInstance.

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

Start up a schedule thread that calls the aDcaInstance::schedule() method in a loop.

It can be stopped by a call to ShutdownScheduleThread()

Schedule event information will be captured and handled by pSubscriber.

Note
There are separate implementations for Windows and Linux distributions.
See also
shutdownScheduleThread

Definition at line 67 of file url_samples/urldbsample_extended/linux/schedule_thread.cpp.

◆ shutdownScheduleThread()

void shutdownScheduleThread ( )

Shuts down the previously started schedule thread.

Shutting down will stop the thread 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.
There are separate implementations for Windows and Linux distributions.
See also
createScheduleThread

Definition at line 75 of file url_samples/urldbsample_extended/linux/schedule_thread.cpp.