This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SimpleDateFormat thread problems?


Vladimir Leven wrote:

I did try putting "synchronize" keyword around getStats() method, but this did not solve the problem of the main scheduler thread hanging. Also, it seems to me that synchronization should not be required in the first place, since all I am doing is creating a Date from a long (which is updated by another thread, but presumably this.time = System.currentTimeMillis is atomic?) and then using SimpleDateFormat to print it.


As Tom points out, long operations arn't guaranteed to be atomic, but I think that's unlikely to be the problem here.

Related question: Is there a way to dump the stack trace for a given thread? I can only seem to look at the stack trace for the currently running thread.

As for the patch, how do I apply it? Do I have to recompile all of GCC?


Something like:

patch -l -p(n) < file.patch

If you're applying the patch to an already built source tree, you should just be able to type "make install" and it will only rebuild the parts of libjava that have changed.

Regards

Bryce.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]