00001 #ifdef TEST
00002
00003 #include "headers.h"
00004
00005 static pthread_cond_t myCondition;
00006
00010
00011 string
00012 TimerCommand::getCommandString() {
00013 return timerCommandString;
00014 }
00015
00016
00020 void*
00021 sampleWake(void* arg) {
00022 stringstream s;
00023 TimeValue tmp(TimeValue::getCurrentTime());
00024 s << tmp;
00025 debug(DEBUG_TIMER, "Time: %s, Message: %s", s.str().c_str(), (char*)arg);
00026 return NULL;
00027 }
00028
00029
00030 void*
00031 sampleSignal(void* arg) {
00032 debug(DEBUG_TIMER, "Signalling");
00033 pthread_cond_signal(&myCondition);
00034 return NULL;
00035 }
00036
00037
00038 void
00039 TimerCommand::run(std::ostream& s)
00040 {
00041 bool* isValid = new bool;
00042 bool* isValid2 = new bool;
00043 *isValid = true;
00044 *isValid2 = true;
00045 Condition myCondition;
00046 Mutex myMutex;
00047 myMutex.lock();
00048
00049 debug(DEBUG_TIMER, "Starting timer test");
00050
00051 myCondition.timedWait(&myMutex, 15000);
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 }
00084
00085
00086 #endif
00087