boost::thread_resource_error I am getting this error in the debug.log of bitcoind:

EXCEPTION: N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEEE
boost::thread_resource_error 

It happens every 2 to 4 hours, and I need to restart bitcoind.

What I do is I request recent transactions every 2 seconds, via json-rpc.

Does anybody else got this error? Is there a way of avoiding this error?

UPDATE:

I actually managed to figure out it is related to calling walletlock. Whenever walletlock is called (via json-rpc or command line, doesn't matter), a new thread is spawned and it doesn't die. Looks like a bug.
It seems to be an error from the Boost library that is thrown "thread-related resources cannot be acquired". You probably should contact the dev team about this error, from your description it appears to be a memory leak.