There were more problems in gij related to the lack of locking when resolving constants. This patch fixes the problems by using fine-grained locking whenever accessing the constant pool. This lack of synchronization did not affect precompiled code because gcj resolves constants by emitting calls _Jv_ResolvePoolEntry, and that function locks the class whenever updating the constant pool. While coarse, this does guarantee that the data races in the interpreter cannot occur, which is why we've never seen this problem with precompiled code. In theory the class lock in _Jv_ResolvePoolEntry could now be removed because the new fine-grained locking makes it unnececessary. However, I'm not going to remove it yet. Andrew.