Revision 1234

branches/threaded2merge/src/linad99/adthread.h (revision 1234)
27 27
};
28 28
class adpthread_manager
29 29
{
30
private:
30 31
  int num_code;
31
  static int old_buffer_flag;
32 32
  int logflag;
33 33
  static __thread int slave_number;
34
  adtimer * adt;
35
  pofstream * logfiles;
34
  adtimer* adt;
35
  pofstream* logfiles;
36 36
  ppthreadfun ppf;
37 37
public:
38 38
  adpthread_manager(int ns,int bs);
......
40 40
  virtual ~adpthread_manager() {}
41 41

  
42 42
public:
43
  static int is_slave(void) { if (slave_number)
44
                                  return 1;
45
                                else
46
                                  return 0; }
47
  static int is_master(void) { if (slave_number)
48
                                  return 0;
49
                                else
50
                                  return 1; }
43
  static bool is_slave(void) { return slave_number ? true : false; }
44
  static bool is_master(void) { return !is_slave(); }
45
  static void set_slave_number(int n) { slave_number = n; }
51 46
  static int get_slave_number(void) { return slave_number; }
52
  static void set_slave_number(int n) { slave_number=n; }
53
  static void set_old_buffer_flag(int n) { old_buffer_flag=n;}
54 47

  
55 48
  int nslaves;
56 49
  int initial_buffer_size;
57 50
  int ngroups;
58 51
  ivector gmin;
59 52
  ivector gmax;
60
  int nfun;
61 53
  ivector num_in_group;
62 54
  int bs;
63 55
  ivector mflag;
64 56
  ivector sflag;
65 57
  ivector buffer_size;
66 58
  pthread_mutex_t copy_mutex;
67
  pthread_mutex_t start_mutex;
68 59
  pthread_mutex_t* smutex;
69 60
  pthread_cond_t* scondition;
70 61
  pthread_cond_t* mcondition;
......
74 65
  char*** sbuffend;
75 66
  imatrix smflag;
76 67
  imatrix ssflag;
77
  pthread_mutex_t ** ssmutex;
78
  pthread_cond_t ** sscondition;
79
  pthread_cond_t ** smcondition;
80
  pthread_t * thread1;  /* thread variables */
68
  pthread_mutex_t** ssmutex;
69
  pthread_cond_t** sscondition;
70
  pthread_cond_t** smcondition;
71
  pthread_t* thread1;
81 72

  
82 73
  void attach_code(pthreadfun pf);
83 74
  void check_buffer_size(int, int,int);
branches/threaded2merge/src/linad99/xthread_stuff.cpp (revision 1234)
122 122
    //*(logfiles[0]) << tm << " adjoint_write_lock_buffer_master"   << endl;
123 123
  }
124 124
}
125

  
126 125
void adjoint_adwrite_lock_buffer_2(void)
127 126
{
128 127
  verify_identifier_string("CY");
129 128
  adpthread_manager * ptr=(adpthread_manager*)(restore_pointer_value());
130 129
  ptr->adjoint_adwrite_lock_buffer_2();
131 130
}
132

  
133 131
void adpthread_manager::adjoint_adwrite_lock_buffer_2(void)
134 132
{
135 133
  //unlock read buffer slave
......
214 212
    }
215 213
  }
216 214
}   
217

  
218 215
void adpthread_manager::cwrite_unlock_buffer(int sno)
219 216
{
220 217
  // we should be using the mutexes from the class
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff