Skip to content

Commit

Permalink
thread-safety issue: move ByteBuffer construction to synchronized block
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgheymans committed Jul 5, 2013
1 parent 38b7da3 commit 509d34f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/uniq/UniqueId.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public byte[] getId() {
seq = 0;
}
seq++;
ByteBuffer bb = tlbb.get();
bb.rewind();
bb.putLong(time);
bb.put(node);
bb.putShort((short)seq);
return bb.array();
}
ByteBuffer bb = tlbb.get();
bb.rewind();
bb.putLong(time);
bb.put(node);
bb.putShort((short)seq);
return bb.array();
}

public String getStringId() {
Expand Down

0 comments on commit 509d34f

Please sign in to comment.