Revision 81b601c1 loop-mt.c

View differences:

loop-mt.c
22 22
#include "loop.h"
23 23

  
24 24
#define BUFFSIZE 512 * 1024
25
#define FDSSIZE 16
25 26
static int chunks_per_period = 1;
26 27
static int period = 500000;
27 28
static int done;
28
static pthread_mutex_t cb_mutex;
29
static pthread_mutex_t topology_mutex;
29
pthread_mutex_t cb_mutex;
30
pthread_mutex_t topology_mutex;
30 31
static struct nodeID *s;
31 32

  
32 33
static void *chunk_forging(void *dummy)
......
184 185
  chunks_per_period = chunks;
185 186
  s = s1;
186 187
 
187
  sigInit(s);
188
  int fds[FDSSIZE];
189
  fds[0] = -1;
190

  
191
//  sigInit(s);
188 192
  peers_init();
189
  if (source_init(fname, s, loop) < 0) {
193
  if (source_init(fname, s, loop, fds, FDSSIZE) < 0) {
190 194
    fprintf(stderr,"Cannot initialize source, exiting");
191 195
    return;
192 196
  }
......
194 198
  pthread_mutex_init(&topology_mutex, NULL);
195 199
  pthread_create(&receive_thread, NULL, source_receive, NULL); 
196 200
  pthread_create(&gossiping_thread, NULL, topology_sending, NULL); 
197
  pthread_create(&generate_thread, NULL, chunk_forging, NULL); 
201
#ifndef HTTPIO
198 202
  pthread_create(&distributing_thread, NULL, chunk_sending, NULL); 
203
  pthread_create(&generate_thread, NULL, chunk_forging, NULL); 
204
#endif
199 205

  
206
#ifndef HTTPIO
200 207
  pthread_join(generate_thread, NULL);
208
  pthread_join(distributing_thread, NULL);
209
#endif
201 210
  pthread_join(receive_thread, NULL);
202 211
  pthread_join(gossiping_thread, NULL);
203
  pthread_join(distributing_thread, NULL);
204 212
}

Also available in: Unified diff