return jhash(&a->func, size, 0);
}
-static int cpu_record_hash_cmp(const struct cpu_thread_history *a,
+static bool cpu_record_hash_cmp(const struct cpu_thread_history *a,
const struct cpu_thread_history *b)
{
return a->func == b->func;
rv->cpu_record = hash_create_size(
8, (unsigned int (*)(void *))cpu_record_hash_key,
- (int (*)(const void *, const void *))cpu_record_hash_cmp,
+ (bool (*)(const void *, const void *))cpu_record_hash_cmp,
"Thread Hash");
XFREE(MTYPE_THREAD_MASTER, m);
}
-/* Return remain time in second. */
-unsigned long thread_timer_remain_second(struct thread *thread)
+/* Return remain time in miliseconds. */
+unsigned long thread_timer_remain_msec(struct thread *thread)
{
int64_t remain;
pthread_mutex_lock(&thread->mtx);
{
- remain = monotime_until(&thread->u.sands, NULL) / 1000000LL;
+ remain = monotime_until(&thread->u.sands, NULL) / 1000LL;
}
pthread_mutex_unlock(&thread->mtx);
return remain < 0 ? 0 : remain;
}
+/* Return remain time in seconds. */
+unsigned long thread_timer_remain_second(struct thread *thread)
+{
+ return thread_timer_remain_msec(thread) / 1000LL;
+}
+
#define debugargdef const char *funcname, const char *schedfrom, int fromln
#define debugargpass funcname, schedfrom, fromln