I see that the code uses the pthread library and that threads are used but I see no -D_REENTRANT compile flag.
I know that without this flag you can get many hard to reproduce problems because without the flag, errno and is NOT threadsafe. Please see http://pauillac.inria.fr/~xleroy/linuxthreads/faq.html sect H for details.
After some Googling it would appear the proper way to use threads with the newer gcc releases is to use the -pthread flag as this will then apply the correct flags to both the compiler and the linker. Can somebody create some beta builds with this change made so that we can see if there is an improvement? I am looking for a Sparc build for my ReadyNAS X6.