summaryrefslogtreecommitdiffstats
path: root/fastos/src/tests/job.h
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahoo-inc.com>2016-06-30 14:42:53 +0200
committerArne H Juul <arnej@yahoo-inc.com>2016-06-30 15:02:16 +0200
commitfbd5218f6bfd0c7ff53b9c44ecef570e1db3b51a (patch)
tree26cfdf7d617d6bd16354e1613f083a6262b59fbb /fastos/src/tests/job.h
parent64d8495c7715566069edee8e6d0dad0aa9e78db3 (diff)
jobs.h -> job.h
Diffstat (limited to 'fastos/src/tests/job.h')
-rw-r--r--fastos/src/tests/job.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/fastos/src/tests/job.h b/fastos/src/tests/job.h
new file mode 100644
index 00000000000..1f771effba3
--- /dev/null
+++ b/fastos/src/tests/job.h
@@ -0,0 +1,66 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#pragma once
+
+enum JobCode
+{
+ PRINT_MESSAGE_AND_WAIT3SEC,
+ INCREASE_NUMBER,
+ PRIORITY_TEST,
+ WAIT_FOR_BREAK_FLAG,
+ WAIT_FOR_THREAD_TO_FINISH,
+ WAIT_FOR_CONDITION,
+ BOUNCE_CONDITIONS,
+ TEST_ID,
+ WAIT2SEC_AND_SIGNALCOND,
+ HOLD_MUTEX_FOR2SEC,
+ WAIT_2_SEC,
+ SILENTNOP,
+ NOP
+};
+
+class Job
+{
+private:
+ Job(const Job &);
+ Job &operator=(const Job&);
+
+public:
+ JobCode code;
+ char *message;
+ FastOS_Mutex *mutex;
+ FastOS_Cond *condition;
+ FastOS_BoolCond *boolcondition;
+ FastOS_ThreadInterface *otherThread, *ownThread;
+ double *timebuf;
+ double average;
+ int result;
+ FastOS_ThreadId _threadId;
+ Job *otherjob;
+ int bouncewakeupcnt;
+ bool bouncewakeup;
+
+ Job()
+ : code(NOP),
+ message(NULL),
+ mutex(NULL),
+ condition(NULL),
+ boolcondition(NULL),
+ otherThread(NULL),
+ ownThread(NULL),
+ timebuf(NULL),
+ average(0.0),
+ result(-1),
+ _threadId(),
+ otherjob(NULL),
+ bouncewakeupcnt(0),
+ bouncewakeup(false)
+ {
+ }
+
+ ~Job()
+ {
+ if(message != NULL)
+ free(message);
+ }
+};