Thanks for the patch, David. I had played with a similar patch myself (see the attached file, d5623-1.diff). My patch differs a little from your patch:
- It preserves the synchronization in getDaemonThread(). Without synchronization in that method, I saw occasional IllegalThreadStateExceptions when booting and shutting down databases concurrently in many threads.
- It uses PrivilegedAction instead of PrivilegedExceptionAction for the actions that don't throw checked exceptions, which made the exception handling simpler.
All the regression tests passed with this patch.
I also ran an application that booted 1000 databases in 20 threads on a machine with 8 cores, and the patch seemed to speed it up by 3-4%. It was primarily the removal of synchronization in getJVMProperty() that contributed to the speed-up.
Although the speed-up is modest (at least in my environment) the patches remove more lines of code than they add, which is a good thing in itself.