my_thread: Use unsigned long long for storing pthread IDs
This is a fix for operating systems that have pthread_t defined as a pointer and use the default pthread_self() mechanism for identifying threads. More specifically, this is a build fix for NetBSD. Any changes I submit are freely available under the new BSD license. Signed-off-by: Nia Alarie <nia@NetBSD.org>
This commit is contained in:
parent
139333a6cc
commit
68eac8a3ad
@ -17,7 +17,7 @@
|
|||||||
typedef pthread_key_t thread_local_key_t;
|
typedef pthread_key_t thread_local_key_t;
|
||||||
typedef pthread_t my_thread_handle;
|
typedef pthread_t my_thread_handle;
|
||||||
typedef pthread_attr_t my_thread_attr_t;
|
typedef pthread_attr_t my_thread_attr_t;
|
||||||
typedef uint32 my_thread_os_id_t;
|
typedef unsigned long long my_thread_os_id_t;
|
||||||
|
|
||||||
#define LOCK_plugin_delete LOCK_plugin
|
#define LOCK_plugin_delete LOCK_plugin
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ static inline my_thread_os_id_t my_thread_os_id()
|
|||||||
#else
|
#else
|
||||||
#ifdef HAVE_INTEGER_PTHREAD_SELF
|
#ifdef HAVE_INTEGER_PTHREAD_SELF
|
||||||
/* Unknown platform, fallback. */
|
/* Unknown platform, fallback. */
|
||||||
return pthread_self();
|
return (unsigned long long)pthread_self();
|
||||||
#else
|
#else
|
||||||
/* Feature not available. */
|
/* Feature not available. */
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user