Grappa  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Grappa::CompletionEvent Class Reference

Synchronization primitive useful for waking a worker after a number of other things complete. More...

#include <CompletionEvent.hpp>

Inheritance diagram for Grappa::CompletionEvent:
Grappa::GlobalCompletionEvent

Public Member Functions

 CompletionEvent (int64_t count=0)
 
int64_t get_count () const
 
void enroll (int64_t inc=1)
 
void complete (int64_t decr=1)
 Decrement count once, if count == 0, wake all waiters. More...
 
void wait ()
 
void wait (SuspendedDelegate *c)
 
void reset ()
 
void send_completion (Core origin, int64_t decr=1)
 

Protected Attributes

ConditionVariable cv
 
int64_t count
 

Detailed Description

Synchronization primitive useful for waking a worker after a number of other things complete.

All waiting tasks will be woken as soon as the count goes to 0. Use enroll() to add more tasks.

Fulfills the ConditionVariable type_trait.

Definition at line 45 of file CompletionEvent.hpp.

Constructor & Destructor Documentation

Grappa::CompletionEvent::CompletionEvent ( int64_t  count = 0)
inline

Definition at line 50 of file CompletionEvent.hpp.

Member Function Documentation

void Grappa::CompletionEvent::complete ( int64_t  decr = 1)
inline

Decrement count once, if count == 0, wake all waiters.

Definition at line 59 of file CompletionEvent.hpp.

void Grappa::CompletionEvent::enroll ( int64_t  inc = 1)
inline

Definition at line 54 of file CompletionEvent.hpp.

int64_t Grappa::CompletionEvent::get_count ( ) const
inline

Definition at line 52 of file CompletionEvent.hpp.

void Grappa::CompletionEvent::reset ( )
inline

Definition at line 84 of file CompletionEvent.hpp.

void Grappa::CompletionEvent::wait ( )
inline

Definition at line 69 of file CompletionEvent.hpp.

void Grappa::CompletionEvent::wait ( SuspendedDelegate c)
inline

Definition at line 75 of file CompletionEvent.hpp.

Member Data Documentation

int64_t Grappa::CompletionEvent::count
protected

Definition at line 48 of file CompletionEvent.hpp.

ConditionVariable Grappa::CompletionEvent::cv
protected

Definition at line 47 of file CompletionEvent.hpp.


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