XRootD
XrdCmsRespQ Class Reference

#include <XrdCmsResp.hh>

+ Collaboration diagram for XrdCmsRespQ:

Public Member Functions

 XrdCmsRespQ ()
 
 ~XrdCmsRespQ ()
 
void Add (XrdCmsResp *rp)
 
void Purge ()
 
XrdCmsRespRem (int msgid)
 

Detailed Description

Definition at line 123 of file XrdCmsResp.hh.

Constructor & Destructor Documentation

◆ XrdCmsRespQ()

XrdCmsRespQ::XrdCmsRespQ ( )

Definition at line 241 of file XrdCmsResp.cc.

242 {
243  memset(mqTab, 0, sizeof(mqTab));
244 }

◆ ~XrdCmsRespQ()

XrdCmsRespQ::~XrdCmsRespQ ( )
inline

Definition at line 133 of file XrdCmsResp.hh.

133 {Purge();}
void Purge()
Definition: XrdCmsResp.cc:267

References Purge().

+ Here is the call graph for this function:

Member Function Documentation

◆ Add()

void XrdCmsRespQ::Add ( XrdCmsResp rp)

Definition at line 250 of file XrdCmsResp.cc.

251 {
252  int i;
253 
254 // Compute index and either add or chain the entry
255 //
256  i = rp->myID % mqSize;
257  myMutex.Lock();
258  rp->next = (mqTab[i] ? mqTab[i] : 0);
259  mqTab[i] = rp;
260  myMutex.UnLock();
261 }

Referenced by XrdCmsClientMan::delayResp().

+ Here is the caller graph for this function:

◆ Purge()

void XrdCmsRespQ::Purge ( )

Definition at line 267 of file XrdCmsResp.cc.

268 {
269  XrdCmsResp *rp;
270  int i;
271 
272  myMutex.Lock();
273  for (i = 0; i < mqSize; i++)
274  {while ((rp = mqTab[i])) {mqTab[i] = rp->next; delete rp;}}
275  myMutex.UnLock();
276 }

Referenced by ~XrdCmsRespQ(), and XrdCmsClientMan::delayResp().

+ Here is the caller graph for this function:

◆ Rem()

XrdCmsResp * XrdCmsRespQ::Rem ( int  msgid)

Definition at line 282 of file XrdCmsResp.cc.

283 {
284  int i;
285  XrdCmsResp *rp, *pp = 0;
286 
287 // Compute the index and find the entry
288 //
289  i = msgid % mqSize;
290  myMutex.Lock();
291  rp = mqTab[i];
292  while(rp && rp->myID != msgid) {pp = rp; rp = rp->next;}
293 
294 // Remove the entry if we found it
295 //
296  if (rp) {if (pp) pp->next = rp->next;
297  else mqTab[i] = rp->next;
298  }
299 
300 // Return what we found
301 //
302  myMutex.UnLock();
303  return rp;
304 }

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