Revision abd2ef3b streaming.c

View differences:

streaming.c
16 16
#include "input.h"
17 17
#include "dbg.h"
18 18
#include "chunk_signaling.h"
19
#include "chunklock.h"
19 20

  
20 21
#include "scheduler_la.h"
21 22

  
......
23 24
static struct input_desc *input;
24 25
static int cb_size;
25 26
static int transid=0;
26
struct chunkID_set *lock_set;
27 27

  
28 28
int _needs(struct chunkID_set *cset, int cb_size, int cid);
29 29

  
30
void chunk_lock(int chunkid,struct peer *from){
31
  if (!lock_set) lock_set = chunkID_set_init(16);
32

  
33
  chunkID_set_add_chunk(lock_set, chunkid);
34
}
35

  
36
void chunk_unlock(int chunkid){
37
  if (!lock_set) return;
38
  chunkID_set_remove_chunk(lock_set, chunkid);
39
}
40

  
41
int chunk_islocked(int chunkid){
42
  int r;
43

  
44
  if (!lock_set) return 0;
45
  r = chunkID_set_check(lock_set, chunkid);
46
  return (r >= 0);
47
}
48

  
49 30
void stream_init(int size, struct nodeID *myID)
50 31
{
51 32
  char conf[32];

Also available in: Unified diff