Skip to content
Permalink
Browse files

Merge pull request #3589 from donaldsharp/self_vs_thread

lib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can
  • Loading branch information...
mjstapp committed Jan 10, 2019
2 parents c065db3 + 231db9a commit a311fb565344e7398c452638bf2701644c7e5c42
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/thread.c
@@ -1572,8 +1572,13 @@ void thread_set_yield_time(struct thread *thread, unsigned long yield_time)

void thread_getrusage(RUSAGE_T *r)
{
#if defined RUSAGE_THREAD
#define FRR_RUSAGE RUSAGE_THREAD
#else
#define FRR_RUSAGE RUSAGE_SELF
#endif
monotime(&r->real);
getrusage(RUSAGE_SELF, &(r->cpu));
getrusage(FRR_RUSAGE, &(r->cpu));
}

/*

0 comments on commit a311fb5

Please sign in to comment.
You can’t perform that action at this time.