XnScheduler.h File Reference
`#include <XnOS.h>`

Go to the source code of this file.

## Macros

#define | XN_MASK_SCHEDULER "Scheduler"

## Typedefs

typedef struct XnScheduler | XnScheduler
typedef struct XnScheduledTask | XnScheduledTask
typedef void(* | XnTaskCallbackFuncPtr) (void *pCallbackArg)

## Functions

XN_C_API XnStatus XN_C_DECL | xnSchedulerStart (XnScheduler **ppScheduler)
XN_C_API XnStatus XN_C_DECL | xnSchedulerShutdown (XnScheduler **ppScheduler)
XN_C_API XnStatus XN_C_DECL | xnSchedulerAddTask (XnScheduler *pScheduler, XnUInt64 nInterval, XnTaskCallbackFuncPtr pCallback, void *pCallbackArg, XnScheduledTask **ppTask)
XN_C_API XnStatus XN_C_DECL | xnSchedulerRemoveTask (XnScheduler *pScheduler, XnScheduledTask **ppTask)
XN_C_API XnStatus XN_C_DECL | xnSchedulerRescheduleTask (XnScheduler *pScheduler, XnScheduledTask *pTask, XnUInt64 nInterval)

## Macro Definition Documentation

## XN_MASK_SCHEDULER

#define XN_MASK_SCHEDULER "Scheduler"

## Typedef Documentation

## XnScheduledTask

typedef struct XnScheduledTask XnScheduledTask

## XnScheduler

typedef struct XnScheduler XnScheduler

## XnTaskCallbackFuncPtr

typedef void(* XnTaskCallbackFuncPtr) (void *pCallbackArg)

## Function Documentation

## xnSchedulerAddTask()

XN_C_API XnStatus XN_C_DECL xnSchedulerAddTask | ( | XnScheduler * | pScheduler,
|  | XnUInt64 | nInterval,
|  | XnTaskCallbackFuncPtr | pCallback,
|  | void * | pCallbackArg,
|  | XnScheduledTask ** | ppTask )

Adds a task to the scheduler.

Parameters

  pScheduler | [in] The scheduler to handle this task.
  nInterval | [in] The interval, in milliseconds, in which callback should be called.
  pCallback | [in] The function to be called when time arrived.
  pCallbackArg | [in] The argument that will be passed to the callback method.
  ppTask | [out] Upon successful return, holds a handle to the started task.

## xnSchedulerRemoveTask()

XN_C_API XnStatus XN_C_DECL xnSchedulerRemoveTask | ( | XnScheduler * | pScheduler,
|  | XnScheduledTask ** | ppTask )

Removes a task from the scheduler.

Parameters

  pScheduler | [in] The scheduler this task is registered to.
  ppTask | [in/out] The task to be removed from the scheduler.

## xnSchedulerRescheduleTask()

XN_C_API XnStatus XN_C_DECL xnSchedulerRescheduleTask | ( | XnScheduler * | pScheduler,
|  | XnScheduledTask * | pTask,
|  | XnUInt64 | nInterval )

Changes scheduling of a specific task.

Parameters

  pScheduler | [in] The scheduler this task is registered to.
  pTask | [in] The task to be removed from the scheduler.
  nInterval | [in] The new interval to be used.

## xnSchedulerShutdown()

XN_C_API XnStatus XN_C_DECL xnSchedulerShutdown | ( | XnScheduler ** | ppScheduler | ) |

Shuts down a scheduler thread. All timers on that scheduler will be stopped.

Parameters

  ppScheduler | [in/out] A pointer to the scheduler to be shut down.

## xnSchedulerStart()

XN_C_API XnStatus XN_C_DECL xnSchedulerStart | ( | XnScheduler ** | ppScheduler | ) |

Starts a scheduler thread. Multiple timers can be added to the created scheduler.

Parameters

  ppScheduler | [out] Upon successful return, holds a handle to created scheduler.