![]() |
![]() |
Data Structures | |
struct | Rendezvous_Attrs |
Attributes used to create a Rendezvous. More... | |
Defines | |
#define | Rendezvous_INFINITE -1 |
Typedefs | |
typedef struct Rendezvous_Object * | Rendezvous_Handle |
Handle through which to reference a Rendezvous Object. | |
Functions | |
Rendezvous_Handle | Rendezvous_create (Int count, Rendezvous_Attrs *attrs) |
Creates a Rendezvous Object. Must be called before a Rendezvous_Handle can be used in subsequent operations. | |
Void | Rendezvous_meet (Rendezvous_Handle hRv) |
Called by a thread when it's ready to meet up with other threads. This will register that the thread is ready, and will block the calling thread until a total number of count threads have called this function on this Rendezvous object. When this happens, all threads are unblocked at once and the Rendezvous object will be reset to it's original count. | |
Void | Rendezvous_force (Rendezvous_Handle hRv) |
This call forces all threads blocking in Rendezvous_meet to unblock no matter what the state of the Rendezvous object. Useful for e.g. error cleanup. To reuse a Rendezvous object after this call, Rendezvous_reset must be called. | |
Void | Rendezvous_reset (Rendezvous_Handle hRv) |
This call resets the Rendezvous object to it's original count at opening time. | |
Void | Rendezvous_forceAndReset (Rendezvous_Handle hRv) |
This call is equivalent to calling Rendezvous_force followed by Rendezvous_reset in a single operation. This will ensure that calls to Rendezvous_meet will not fail to block in-between the calls to Rendezvous_force and Rendezvous_reset if they were called separately. | |
Int | Rendezvous_delete (Rendezvous_Handle hRv) |
Deletes a previously created Rendezvous object. | |
Variables | |
const Rendezvous_Attrs | Rendezvous_Attrs_DEFAULT |
Default attributes for a Rendezvous. |
main: #include <xdc/std.h> #include <ti/sdo/dmai/Dmai.h> #include <ti/sdo/dmai/Rendezvous.h> Rendezvous_Attrs rzvAttrs = Rendezvous_Attrs_DEFAULT; Dmai_init(); // We want to synchronize 2 threads: Rendezvous_Handle hRv = Rendezvous_create(2, &rzvAttrs); thread1: extern Rendezvous_Handle hRv; // Do thread initialization // Thread will block here until thread2 is done with init also: Rendezvous_meet(hRv); // Do main loop when both threads are done initializing. thread2: extern Rendezvous_Handle hRv; // Do thread initialization // Thread will block here until thread1 is done with init also: Rendezvous_meet(hRv); // Do main loop when both threads are done initializing.
#define Rendezvous_INFINITE -1 |
typedef struct Rendezvous_Object* Rendezvous_Handle |
Handle through which to reference a Rendezvous Object.
Rendezvous_Handle Rendezvous_create | ( | Int | count, | |
Rendezvous_Attrs * | attrs | |||
) |
Creates a Rendezvous Object. Must be called before a Rendezvous_Handle can be used in subsequent operations.
count | Number of threads to synchronize. Use Rendezvous_INFINITE for a Rendezvous that can only be unblocked with Rendezvous_force or Rendezvous_forceAndReset. | |
[in] | attrs | Rendezvous_Attrs to use for creating the Rendezvous instance. |
Handle | for use in subsequent operations (see Rendezvous_Handle) | |
NULL | for failure. |
Void Rendezvous_meet | ( | Rendezvous_Handle | hRv | ) |
Called by a thread when it's ready to meet up with other threads. This will register that the thread is ready, and will block the calling thread until a total number of count threads have called this function on this Rendezvous object. When this happens, all threads are unblocked at once and the Rendezvous object will be reset to it's original count.
hRv | The Rendezvous_Handle in which to meet. |
Void Rendezvous_force | ( | Rendezvous_Handle | hRv | ) |
This call forces all threads blocking in Rendezvous_meet to unblock no matter what the state of the Rendezvous object. Useful for e.g. error cleanup. To reuse a Rendezvous object after this call, Rendezvous_reset must be called.
hRv | The Rendezvous_Handle to force. |
Void Rendezvous_reset | ( | Rendezvous_Handle | hRv | ) |
This call resets the Rendezvous object to it's original count at opening time.
hRv | The Rendezvous_Handle to reset. |
Void Rendezvous_forceAndReset | ( | Rendezvous_Handle | hRv | ) |
This call is equivalent to calling Rendezvous_force followed by Rendezvous_reset in a single operation. This will ensure that calls to Rendezvous_meet will not fail to block in-between the calls to Rendezvous_force and Rendezvous_reset if they were called separately.
hRv | The Rendezvous_Handle to force. |
Int Rendezvous_delete | ( | Rendezvous_Handle | hRv | ) |
Deletes a previously created Rendezvous object.
hRv | The Rendezvous_Handle to delete. |
Dmai_EOK | for success. | |
Negative value | for failure, see Dmai.h. |
Default attributes for a Rendezvous.