projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
afdf7f7
)
Altered MACH kernel thread id modification to guarantee uniqueness
author
Ian Silvester
<iansilvester@fastmail.fm>
Tue, 26 Jan 2016 17:12:14 +0000
(17:12 +0000)
committer
Ian Silvester
<iansilvester@fastmail.fm>
Tue, 26 Jan 2016 17:12:14 +0000
(17:12 +0000)
errlog.c
patch
|
blob
|
history
diff --git
a/errlog.c
b/errlog.c
index
55040e1
..
6daf818
100644
(file)
--- a/
errlog.c
+++ b/
errlog.c
@@
-1,4
+1,4
@@
-const char errlog_rcs[] = "$Id: errlog.c,v 1.12
3 2016/01/21 13:02:10
diem Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.12
4 2016/01/21 20:53:01
diem Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
@@
-422,11
+422,10
@@
static long get_thread_id(void)
#ifdef __MACH__
/*
* Mac OSX (and perhaps other Mach instances) doesn't have a unique
#ifdef __MACH__
/*
* Mac OSX (and perhaps other Mach instances) doesn't have a unique
- * value at the lowest order 4 bytes of pthread_self()'s return value, a pthread_t.
- * pthread_t is supposed to be opaque... however it's fairly random.
- * The following will address these two issues to make it mostly presentable.
+ * value at the lowest order 4 bytes of pthread_self()'s return value, a pthread_t,
+ * so trim the three lowest-order bytes from the value (16^3).
*/
*/
- this_thread =
labs(this_thread % 1000)
;
+ this_thread =
this_thread / 4096
;
#endif /* def __MACH__ */
#elif defined(_WIN32)
this_thread = GetCurrentThreadId();
#endif /* def __MACH__ */
#elif defined(_WIN32)
this_thread = GetCurrentThreadId();