Re: svn commit: r824006 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net: DatagramPacket.java DatagramSocket.java

2009-10-14 Thread Tim Ellison
On 13/Oct/2009 19:59, Jesse Wilson wrote: On Mon, Oct 12, 2009 at 7:18 PM, Nathan Beyer nbe...@gmail.com wrote: Honestly, the synchronization probably isn't appropriate on any of the accessor/mutators - the granularity isn't correct. The locking probably needs to encompass the entire method

Re: svn commit: r824006 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net: DatagramPacket.java DatagramSocket.java

2009-10-14 Thread Nathan Beyer
On Wed, Oct 14, 2009 at 4:17 AM, Tim Ellison t.p.elli...@gmail.com wrote: On 13/Oct/2009 19:59, Jesse Wilson wrote: On Mon, Oct 12, 2009 at 7:18 PM, Nathan Beyer nbe...@gmail.com wrote: Honestly, the synchronization probably isn't appropriate on any of the accessor/mutators - the granularity

Re: svn commit: r824006 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net: DatagramPacket.java DatagramSocket.java

2009-10-13 Thread Jesse Wilson
On Mon, Oct 12, 2009 at 7:18 PM, Nathan Beyer nbe...@gmail.com wrote: Honestly, the synchronization probably isn't appropriate on any of the accessor/mutators - the granularity isn't correct. The locking probably needs to encompass the entire method on DatagramSocket while working on a

Re: svn commit: r824006 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net: DatagramPacket.java DatagramSocket.java

2009-10-12 Thread Tim Ellison
With a simple getting being synchronized like this, I assume it is to get the memory consistency on that field? Looking at DatagramPacket, all of the methods are synchronized. Wouldn't it be better to make these fields volatile, rather than requiring the setters and getters to acquire the lock as

Re: svn commit: r824006 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net: DatagramPacket.java DatagramSocket.java

2009-10-12 Thread Nathan Beyer
On Mon, Oct 12, 2009 at 6:47 AM, Tim Ellison t.p.elli...@gmail.com wrote: With a simple getting being synchronized like this, I assume it is to get the memory consistency on that field? Yep. There were a two or three fields. Looking at DatagramPacket, all of the methods are synchronized.