NAMD
BroadcastClient.C
Go to the documentation of this file.
1 
7 #include "InfoStream.h"
8 #include "charm++.h"
9 #include "BroadcastMgr.h"
10 #include "BroadcastClient.h"
11 #define MIN_DEBUG_LEVEL 3
12 // #define DEBUGM
13 #include "Debug.h"
14 
16  this->id = id;
18  waitForTag = -1;
19  suspended = 0;
20 }
21 
24 }
25 
26 void
27 BroadcastClient::awaken(int theid, int tag) {
28  DebugM(1, "awaken() client id = " << id << " tag = " << tag << "\n");
29  if (suspended && theid == this->id && tag == waitForTag) {
30  CthAwaken(thread);
31  suspended = 0; waitForTag = -1;
32  }
33 }
34 
35 void
37  DebugM(1, "suspending() client id = " << id << " tag = " << tag << "\n");
38  suspended = 1;
39  waitForTag = tag;
40  thread = CthSelf();
41  CthSuspend();
42 }
43 
void awaken(int id, int tag)
#define DebugM(x, y)
Definition: Debug.h:59
void unsubscribe(BroadcastClient &bc)
Definition: BroadcastMgr.C:72
void subscribe(BroadcastClient &bc)
Definition: BroadcastMgr.C:60
void suspendFor(int tag)
static BroadcastMgr * Object()
Definition: BroadcastMgr.h:96
BroadcastClient(int id)