diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5CS.c | 2 | ||||
-rw-r--r-- | src/H5Eint.c | 4 | ||||
-rw-r--r-- | src/H5TS.c | 16 | ||||
-rw-r--r-- | src/H5TSprivate.h | 4 |
4 files changed, 13 insertions, 13 deletions
@@ -145,7 +145,7 @@ H5CS_print_stack(const H5CS_t *fstack, FILE *stream) HDfprintf(stream, "HDF5-DIAG: Function stack from %s ", H5_lib_vers_info_g); /* try show the process or thread id in multiple processes cases*/ - HDfprintf(stream, "thread %lu.", H5TS_thread_id()); + HDfprintf(stream, "thread %" PRIu64 ".", H5TS_thread_id()); if(fstack && fstack->nused>0) HDfprintf(stream, " Back trace follows."); HDfputc('\n', stream); diff --git a/src/H5Eint.c b/src/H5Eint.c index aba912e..7e144c8 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -260,7 +260,7 @@ H5E__walk1_cb(int n, H5E_error1_t *err_desc, void *client_data) HDfprintf(stream, "thread 0"); } /* end block */ #else - HDfprintf(stream, "thread %lu", H5TS_thread_id()); + HDfprintf(stream, "thread %" PRIu64, H5TS_thread_id()); #endif HDfprintf(stream, ":\n"); } /* end if */ @@ -390,7 +390,7 @@ H5E__walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data) HDfprintf(stream, "thread 0"); } /* end block */ #else - HDfprintf(stream, "thread %lu", H5TS_thread_id()); + HDfprintf(stream, "thread %" PRIu64, H5TS_thread_id()); #endif HDfprintf(stream, ":\n"); } /* end if */ @@ -47,12 +47,12 @@ typedef struct _tid h5_tid_t; struct _tid { h5_tid_t *next; - unsigned long id; + uint64_t id; }; /* Pointer to first free thread ID record or NULL. */ static h5_tid_t *tid_next_free = NULL; -static unsigned long tid_next_id = 0; +static uint64_t tid_next_id = 0; /* Mutual exclusion for access to tid_next_free and tid_next_id. */ static pthread_mutex_t tid_mtx; @@ -118,18 +118,18 @@ tid_init(void) pthread_key_create(&tid_key, tid_destructor); } -/* Return an integer identifier, ID, for the current thread satisfies the +/* Return an integer identifier, ID, for the current thread satisfying the * following properties: * - * 1 1 <= ID <= ULONG_MAX - * 2 The ID is constant over the thread's lifetime. + * 1 1 <= ID <= UINT64_MAX + * 2 ID is constant over the thread's lifetime. * 3 No two threads share an ID during their lifetimes. * 4 A thread's ID is available for reuse as soon as it is joined. * * ID 0 is reserved. H5TS_thread_id() returns 0 if the library was not built * with thread safety or if an error prevents it from assigning an ID. */ -unsigned long +uint64_t H5TS_thread_id(void) { h5_tid_t *tid = pthread_getspecific(tid_key); @@ -149,7 +149,7 @@ H5TS_thread_id(void) pthread_mutex_lock(&tid_mtx); if ((tid = tid_next_free) != NULL) tid_next_free = tid->next; - else if (tid_next_id != ULONG_MAX) { + else if (tid_next_id != UINT64_MAX) { tid = &proto_tid; tid->id = ++tid_next_id; } @@ -641,7 +641,7 @@ H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) #else /* H5_HAVE_THREADSAFE */ -unsigned long +uint64_t H5TS_thread_id(void) { return 0; diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h index 76cf8f1..f22ed52 100644 --- a/src/H5TSprivate.h +++ b/src/H5TSprivate.h @@ -68,7 +68,7 @@ H5_DLL void H5TS_win32_process_exit(void); H5_DLL herr_t H5TS_win32_thread_enter(void); H5_DLL herr_t H5TS_win32_thread_exit(void); -#define H5TS_thread_id() ((unsigned long)GetCurrentThreadId()) +#define H5TS_thread_id() ((uint64_t)GetCurrentThreadId()) #else /* H5_HAVE_WIN_THREADS */ @@ -102,7 +102,7 @@ typedef pthread_once_t H5TS_once_t; #define H5TS_mutex_init(mutex) pthread_mutex_init(mutex, NULL) #define H5TS_mutex_lock_simple(mutex) pthread_mutex_lock(mutex) #define H5TS_mutex_unlock_simple(mutex) pthread_mutex_unlock(mutex) -H5_DLL unsigned long H5TS_thread_id(void); +H5_DLL uint64_t H5TS_thread_id(void); #endif /* H5_HAVE_WIN_THREADS */ |