Pause

Implements a pause module to pause and resume processing in threads. More...

Data Structures

struct  Pause_Attrs
 Attributes used to create a Pause. More...

Typedefs

typedef struct Pause_Object * Pause_Handle
 Handle through which to reference a Pause Object.

Functions

Pause_Handle Pause_create (Pause_Attrs *attrs)
 Creates a Pause object.
Void Pause_test (Pause_Handle hPause)
 Called to see if processing is supposed to pause. If so, block the execution of the thread. Otherwise continue.
Void Pause_on (Pause_Handle hPause)
 Called to set processing threads to pause.
Void Pause_off (Pause_Handle hPause)
 Called to release processing threads currently paused.
Int Pause_delete (Pause_Handle hPause)
 Deletes a Pause object.

Variables

const Pause_Attrs Pause_Attrs_DEFAULT
 Default attributes for a Pause.

Detailed Description

Implements a pause module to pause and resume processing in threads.

 main:
   #include <xdc/std.h>
   #include <ti/sdo/dmai/Dmai.h>
   #include <ti/sdo/dmai/Pause.h>
   Pause_Handle hPause;
   Pause_Attrs pAttrs = Pause_Attrs_DEFAULT;

   Dmai_init();
   hPause = Pause_create(&pAttrs);

 thread1:
   extern Pause_Handle hPause;
   Pause_on(hPause);
   // Do things! Anyone executing Pause_test(hPause) here will block.
   Pause off(hPause);

 thread2:
   extern Pause_Handle hPause;
   // If Pause_on(hPause) has been called, the below will block until
   // Pause_off(hPause) is called.
   Pause_test(hPause);

Typedef Documentation

typedef struct Pause_Object* Pause_Handle

Handle through which to reference a Pause Object.


Function Documentation

Pause_Handle Pause_create ( Pause_Attrs attrs  ) 

Creates a Pause object.

Parameters:
[in] attrs Pause_Attrs to use for creating the Pause Object.
Return values:
Handle for use in subsequent operations (see Pause_Handle).
NULL for failure.

Void Pause_test ( Pause_Handle  hPause  ) 

Called to see if processing is supposed to pause. If so, block the execution of the thread. Otherwise continue.

Parameters:
[in] hPause Pause_Handle to test.
Remarks:
Pause_create must be called before this function.

Void Pause_on ( Pause_Handle  hPause  ) 

Called to set processing threads to pause.

Parameters:
[in] hPause Pause_Handle to pause.
Remarks:
Pause_create must be called before this function.

Void Pause_off ( Pause_Handle  hPause  ) 

Called to release processing threads currently paused.

Parameters:
[in] hPause Pause_Handle to release.
Remarks:
Pause_create must be called before this function.

Int Pause_delete ( Pause_Handle  hPause  ) 

Deletes a Pause object.

Parameters:
[in] hPause Pause_Handle of the Paise object to delete.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Pause_create must be called before this function.


Variable Documentation

Default attributes for a Pause.


Copyright 2011, Texas Instruments Incorporated