EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Seamstress.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Seamstress.h
1 #ifndef SEAMSTRESS_SEAMSTRESS_H
2 #define SEAMSTRESS_SEAMSTRESS_H
3 
4 #include <pthread.h>
5 #include <vector>
6 
7 namespace SeamStress { class Needle; }
8 
9 namespace SeamStress
10 {
11  class Seamstress
12  {
13  public:
14  Seamstress();
15  Seamstress(const Seamstress &ss);
16  ~Seamstress();
17 
18  static void *prepare(void *arg);
19 
20  void start();
21  void stop();
22  void sew();
23  void rest();
24 
25  static void init_vector(unsigned long int N, std::vector<Seamstress> &vec);
26  static std::vector<Seamstress*>* create_vector(unsigned long int N);
27 
28 
30  void *thread;
31 
32  private:
33  bool gotime;
34  bool end;
35  bool queue_end;
36  bool running;
37  bool started;
38  pthread_t pthread;
39  pthread_attr_t attr;
40  pthread_mutex_t mutex;
41  pthread_mutexattr_t mattr;
42  pthread_cond_t cond;
43  pthread_cond_t waitcond;
44  };
45 }
46 
47 
48 #endif