Grappa  r3821, hash 22cd626d567a91ead5b23302066d1e9469f45c66
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 56 of file CompletionEvent.hpp.

Constructor & Destructor Documentation

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

Definition at line 61 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 70 of file CompletionEvent.hpp.

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

Definition at line 65 of file CompletionEvent.hpp.

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

Definition at line 63 of file CompletionEvent.hpp.

void Grappa::CompletionEvent::reset ( )
inline

Definition at line 95 of file CompletionEvent.hpp.

void Grappa::CompletionEvent::wait ( )
inline

Definition at line 80 of file CompletionEvent.hpp.

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

Definition at line 86 of file CompletionEvent.hpp.

Member Data Documentation

int64_t Grappa::CompletionEvent::count
protected

Definition at line 59 of file CompletionEvent.hpp.

ConditionVariable Grappa::CompletionEvent::cv
protected

Definition at line 58 of file CompletionEvent.hpp.


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