Revision 0c8299f1 src/logdb/LogDBRequest.cc

View differences:

src/logdb/LogDBRequest.cc
31 31

  
32 32
LogDBRequest::LogDBRequest(unsigned int i, unsigned int t, unsigned int pi,
33 33
        unsigned int pt, const char * s): _index(i), _prev_index(pi), _term(t),
34
        _prev_term(pt), _sql(s), to_commit(-1), replicas(1)
34
        _prev_term(pt), _sql(s), _to_commit(-1), _replicas(1)
35 35
{
36 36
    pthread_mutex_init(&mutex, 0);
37 37
};
......
41 41

  
42 42
int LogDBRequest::replicated()
43 43
{
44
    int _replicas;
44
    int __replicas;
45 45

  
46 46
    lock();
47 47

  
48
    replicas++;
48
    _replicas++;
49 49

  
50
    to_commit--;
50
    if ( _to_commit > 0 )
51
    {
52
        _to_commit--;
53
    }
51 54

  
52
    _replicas = replicas;
55
    __replicas = _replicas;
53 56

  
54
    if ( to_commit == 0 )
57
    if ( _to_commit == 0 )
55 58
    {
56 59
        result  = true;
57 60
        timeout = false;
......
61 64

  
62 65
    unlock();
63 66

  
64
    return _replicas;
67
    return __replicas;
65 68
}
66 69

  

Also available in: Unified diff