check transfer  0.1
Check data transfer for SDAccell OpenCL application
tf_testthread.h
Go to the documentation of this file.
1 /*
2  * TF_TestThread.h
3  *
4  * Created on: Jan 29, 2017
5  * Author: Dmitry Smekhov
6  */
7 
8 #ifndef TF_TestThread_H_
9 #define TF_TestThread_H_
10 
11 #include <pthread.h>
12 #include "tf_test.h"
13 
14 class TableEngine;
15 
16 /**
17  * \brief Base class for application with thread
18  *
19  * Class creates additional thread.
20  *
21  *
22  */
23 class TF_TestThread: public TF_Test
24 {
25 public:
26  TF_TestThread( TableEngine *pTable, int argc, char **argv);
27 
28  virtual ~TF_TestThread();
29 
30  virtual int Prepare(int cnt);
31  virtual void Start();
32  virtual void Stop();
33  virtual int isComplete();
34  virtual void GetResult();
35 
36  static void* ThreadFunc(void* lpvThreadParm);
37 
38  void* Execute();
39 
40  //! Prepare test
41  virtual void PrepareInThread() = 0;
42 
43  //! Free any resource
44  virtual void CleanupInThread() = 0;
45 
46  //! Show result
47  virtual void GetResultInThread() = 0;
48 
49  //! Show status information into test table
50  virtual void StepTable() = 0;
51 
52  //! Main body of user test
53  virtual void Run() = 0;
54 
60 
61  pthread_mutex_t m_ResultStartMutex;
62  pthread_mutex_t m_ResultCompleteMutex;
63  pthread_mutex_t m_StartMutex;
64  pthread_mutex_t m_ThreadExitMutex;
65 
66  pthread_t m_hThread;
67  pthread_attr_t m_attrThread;
68 
69 
70 };
71 
72 #endif /* TF_TestThread_H_ */
pthread_mutex_t m_ResultStartMutex
Definition: tf_testthread.h:61
virtual void GetResultInThread()=0
Show result.
virtual void Start()
Start of test.
static void * ThreadFunc(void *lpvThreadParm)
TF_TestThread(TableEngine *pTable, int argc, char **argv)
virtual void PrepareInThread()=0
Prepare test.
pthread_mutex_t m_StartMutex
Definition: tf_testthread.h:63
int m_isPrepareComplete
Definition: tf_testthread.h:55
Base class for testing device.
Definition: tf_test.h:16
virtual void StepTable()=0
Show status information into test table.
virtual int isComplete()
Return 1 when test is complete.
Base class for application with thread.
Definition: tf_testthread.h:23
virtual int Prepare(int cnt)
Prepare test.
virtual ~TF_TestThread()
pthread_mutex_t m_ResultCompleteMutex
Definition: tf_testthread.h:62
virtual void GetResult()
Show result of test.
pthread_mutex_t m_ThreadExitMutex
Definition: tf_testthread.h:64
virtual void CleanupInThread()=0
Free any resource.
virtual void Stop()
Stop of test.
pthread_t m_hThread
Definition: tf_testthread.h:66
pthread_attr_t m_attrThread
Definition: tf_testthread.h:67
virtual void Run()=0
Main body of user test.