PhoenixThread  1.0.0
Tools to ease parallel programming in C++
Loading...
Searching...
No Matches
DetachPool.cpp File Reference
#include "DetachPool.h"
+ Include dependency graph for DetachPool.cpp:

Go to the source code of this file.

Functions

void phoenix_printThreadStatus (const ListThreadDetachInfo &listThreadInfo, std::ostream &out)
 Print the status of all remaning thread.
 
std::string phoenix_statusToString (int exitStatus)
 Convert the current status of a thread into a string.
 

Function Documentation

◆ phoenix_printThreadStatus()

void phoenix_printThreadStatus ( const ListThreadDetachInfo & listThreadInfo,
std::ostream & out )

Print the status of all remaning thread.

Parameters
listThreadInfo: list of thread information to be printed
out: ostream to be used to print information

Definition at line 25 of file DetachPool.cpp.

25 {
26 out << "ListThreadDetachInfo : number of remaning threads : " << listThreadInfo.size() << std::endl;
27 size_t i(0lu);
28 for(ListThreadDetachInfo::const_iterator it(listThreadInfo.begin()); it != listThreadInfo.end(); ++it){
29 out << "\tthread("<<i<<") '"<<it->description<<"' has status " << phoenix_statusToString(it->exitStatus) << std::endl;
30 ++i;
31 }
32}
std::string phoenix_statusToString(int exitStatus)
Convert the current status of a thread into a string.

References phoenix_statusToString().

+ Here is the call graph for this function:

◆ phoenix_statusToString()

std::string phoenix_statusToString ( int exitStatus)

Convert the current status of a thread into a string.

Parameters
exitStatus: status of the thread
Returns
corresponding string

Definition at line 13 of file DetachPool.cpp.

13 {
14 if(exitStatus == PEXIT_STATUS_NOT_FIHISHED){return "\033[33mStill Running\033[0m";}
15 else if(exitStatus == PEXIT_STATUS_OK){return "\033[32mSUCCESS\033[0m";}
16 else{
17 return "\033[31mFAIL\033[0m";
18 }
19}
#define PEXIT_STATUS_NOT_FIHISHED
Definition DetachPool.h:19
#define PEXIT_STATUS_OK
Definition DetachPool.h:20

References PEXIT_STATUS_NOT_FIHISHED, and PEXIT_STATUS_OK.

Referenced by phoenix_printThreadStatus(), and DetachPool::removeFinishedThread().

+ Here is the caller graph for this function: