Commit e804df26 authored by Andrew Krieger's avatar Andrew Krieger Committed by Facebook Github Bot

Fix potentially uninitialized struct used on MSVC

Summary:
MSVC warns this might be used but uninitialized. Force
the struct to be zero initialized.

Reviewed By: yfeldblum

Differential Revision: D5585320

fbshipit-source-id: 9454a2a4a66c7689f42b1eb211dc57f5d3b88fea
parent d39c5f3d
......@@ -850,6 +850,7 @@ class SharedMutexImpl {
WaitContext& ctx) {
#ifdef RUSAGE_THREAD
struct rusage usage;
std::memset(&usage, 0, sizeof(usage));
long before = -1;
#endif
for (uint32_t yieldCount = 0; yieldCount < kMaxSoftYieldCount;
......@@ -1005,6 +1006,7 @@ class SharedMutexImpl {
#ifdef RUSAGE_THREAD
struct rusage usage;
std::memset(&usage, 0, sizeof(usage));
long before = -1;
#endif
for (uint32_t yieldCount = 0; yieldCount < kMaxSoftYieldCount;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment