diff options
author | Giel van Schijndel <me@mortis.eu> | 2012-06-24 17:03:57 +0200 |
---|---|---|
committer | Giel van Schijndel <me@mortis.eu> | 2012-07-17 01:50:35 +0200 |
commit | 96931d6f78ccc21ec38cd4655b1a250893a6f252 (patch) | |
tree | a7bd6c9bb2d0a9378b6db894b470126d0c2b4221 /src/bitcoinrpc.cpp | |
parent | 1c009d622ded6dd254d6be5161b4df875d492d12 (diff) |
Give threads a recognisable name to aid in debugging
NOTE: These thread names are visible in gdb when using 'info threads'.
Additionally both 'top' and 'ps' show these names *unless* told to
display the command-line instead of task name.
Signed-off-by: Giel van Schijndel <me@mortis.eu>
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r-- | src/bitcoinrpc.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 62b0b497ed..87db11082e 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1569,11 +1569,17 @@ Value keypoolrefill(const Array& params, bool fHelp) void ThreadTopUpKeyPool(void* parg) { + // Make this thread recognisable as the key-topping-up thread + RenameThread("bitcoin-key-top"); + pwalletMain->TopUpKeyPool(); } void ThreadCleanWalletPassphrase(void* parg) { + // Make this thread recognisable as the wallet unlocking thread + RenameThread("bitcoin-unlo-wa"); + int64 nMyWakeTime = GetTimeMillis() + *((int64*)parg) * 1000; ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime); @@ -2479,6 +2485,10 @@ private: void ThreadRPCServer(void* parg) { IMPLEMENT_RANDOMIZE_STACK(ThreadRPCServer(parg)); + + // Make this thread recognisable as the RPC listener + RenameThread("bitcoin-rpclist"); + try { vnThreadsRunning[THREAD_RPCLISTENER]++; @@ -2762,6 +2772,10 @@ static CCriticalSection cs_THREAD_RPCHANDLER; void ThreadRPCServer3(void* parg) { IMPLEMENT_RANDOMIZE_STACK(ThreadRPCServer3(parg)); + + // Make this thread recognisable as the RPC handler + RenameThread("bitcoin-rpchand"); + { LOCK(cs_THREAD_RPCHANDLER); vnThreadsRunning[THREAD_RPCHANDLER]++; |