MongoDB  2.7.0
Public Member Functions | Protected Member Functions | Friends | List of all members
mongo::task::Task Class Referenceabstract

abstraction around threads. More...

#include <task.h>

Inheritance diagram for mongo::task::Task:

Public Member Functions

void halt ()
 for a repeating task, stop after current invocation ends. More...

Protected Member Functions

virtual void setUp ()
virtual void doWork ()=0
virtual string name () const =0


void fork (Task *t)
 run once
void repeat (Task *t, unsigned millis)
 run doWork() over and over, with a pause between runs of millis

Detailed Description

abstraction around threads.

simpler than BackgroundJob which is used behind the scenes. allocate the Task dynamically. when the thread terminates, the Task object will delete itself.

Member Function Documentation

void mongo::task::Task::halt ( )

for a repeating task, stop after current invocation ends.

can be called by other threads as long as the Task is still in scope.

The documentation for this class was generated from the following files: