src/lib/errCatch.c 1.6
1.6 2010/03/05 02:52:17 markd
fixed incorrect assumption about pthread_t being an int
Index: src/lib/errCatch.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/errCatch.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -b -B -U 4 -r1.5 -r1.6
--- src/lib/errCatch.c 28 Dec 2009 17:57:13 -0000 1.5
+++ src/lib/errCatch.c 5 Mar 2010 02:52:17 -0000 1.6
@@ -47,13 +47,13 @@
static struct errCatch **getStack()
/* Return a pointer to the errCatch object stack for the current pthread. */
{
static struct hash *perThreadStacks = NULL;
-int pid = (int)pthread_self();
+pthread_t pid = pthread_self(); // can be a pointer or a number
// A true integer has function would be nicer, but this will do.
// Don't safef, theoretically that could abort.
-char key[16];
-snprintf(key, sizeof(key), "%d", pid);
+char key[64];
+snprintf(key, sizeof(key), "%lld", (long long)pid);
key[ArraySize(key)-1] = '\0';
if (perThreadStacks == NULL)
perThreadStacks = hashNew(0);
struct hashEl *hel = hashLookup(perThreadStacks, key);