title: how to make thread-safe row matrix in java
body: <p>I have a problem: I have a structure that represent a matrix of int. I have to do some operation on single row of this matrix and that operations have to be thread safe. 
  I thought of lock the entire matrix but I want to lock only the single line.
  How can I do that??? thx</p>