#include <unistd.h>
#include <cstring>
#include <argos3/core/simulator/simulator.h>
#include <argos3/core/utility/profiler/profiler.h>
#include "space_multi_thread_balance_quantity.h"
Go to the source code of this file.
|
| argos |
| The namespace containing all the ARGoS related code.
|
|
◆ MAIN_SEND_GO_FOR_PHASE
#define MAIN_SEND_GO_FOR_PHASE |
( |
|
PHASE | ) |
|
Value:
LOGERR.Flush(); \
pthread_mutex_lock(&m_t ## PHASE ## ConditionalMutex); \
m_un ## PHASE ## PhaseDoneCounter = 0; \
pthread_cond_broadcast(&m_t ## PHASE ## Conditional); \
pthread_mutex_unlock(&m_t ## PHASE ## ConditionalMutex);
CARGoSLog LOG(std::cout, SLogColor(ARGOS_LOG_ATTRIBUTE_BRIGHT, ARGOS_LOG_COLOR_GREEN))
Definition at line 178 of file space_multi_thread_balance_quantity.cpp.
◆ MAIN_WAIT_FOR_PHASE_END
#define MAIN_WAIT_FOR_PHASE_END |
( |
|
PHASE | ) |
|
Value: pthread_mutex_lock(&m_t ## PHASE ## ConditionalMutex); \
while(m_un ## PHASE ## PhaseDoneCounter < CSimulator::GetInstance().GetNumThreads()) { \
pthread_cond_wait(&m_t ## PHASE ## Conditional, &m_t ## PHASE ## ConditionalMutex); \
} \
pthread_mutex_unlock(&m_t ## PHASE ## ConditionalMutex);
Definition at line 186 of file space_multi_thread_balance_quantity.cpp.
◆ THREAD_SIGNAL_PHASE_DONE
#define THREAD_SIGNAL_PHASE_DONE |
( |
|
PHASE | ) |
|
Value: pthread_mutex_lock(&m_t ## PHASE ## ConditionalMutex); \
++m_un ## PHASE ## PhaseDoneCounter; \
pthread_cond_broadcast(&m_t ## PHASE ## Conditional); \
pthread_mutex_unlock(&m_t ## PHASE ## ConditionalMutex); \
pthread_testcancel();
Definition at line 265 of file space_multi_thread_balance_quantity.cpp.
◆ THREAD_WAIT_FOR_GO_SIGNAL
#define THREAD_WAIT_FOR_GO_SIGNAL |
( |
|
PHASE | ) |
|
Value: pthread_mutex_lock(&m_t ## PHASE ## ConditionalMutex); \
while(m_un ## PHASE ## PhaseDoneCounter == CSimulator::GetInstance().GetNumThreads()) { \
pthread_cond_wait(&m_t ## PHASE ## Conditional, &m_t ## PHASE ## ConditionalMutex); \
} \
pthread_mutex_unlock(&m_t ## PHASE ## ConditionalMutex); \
pthread_testcancel();
Definition at line 257 of file space_multi_thread_balance_quantity.cpp.