summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b89816a)
segmentation fault when 0 readers due to incorrect mutex array indexing (int vs
long types).
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
}
test_array.a = 0;
test_array.a = 8;
}
test_array.a = 0;
test_array.a = 8;
- for (tidx = nr_readers - 1; tidx >= 0; tidx--) {
+ for (tidx = (long)nr_readers - 1; tidx >= 0; tidx--) {
pthread_mutex_unlock(&per_thread_lock[tidx].lock);
}
nr_writes++;
pthread_mutex_unlock(&per_thread_lock[tidx].lock);
}
nr_writes++;