CloseHandle docs says that the return is non-zero, does not say TRUE(1)

Summary:
say it is TRUE(1). Add assert.
Closes https://github.com/facebook/rocksdb/pull/3630

Differential Revision: D7346895

Pulled By: ajkr

fbshipit-source-id: a46075aa4dd89f32520230606adecccecc874cdf
main
Dmitri Smirnov 7 years ago committed by Facebook Github Bot
parent 93d52696bf
commit 61785c73ed
  1. 6
      port/win/win_thread.cc

@ -138,7 +138,9 @@ void WindowsThread::join() {
"WaitForSingleObjectFailed: thread join");
}
CloseHandle(reinterpret_cast<HANDLE>(data_->handle_));
BOOL rc;
rc = CloseHandle(reinterpret_cast<HANDLE>(data_->handle_));
assert(rc != 0);
data_->handle_ = 0;
}
@ -154,7 +156,7 @@ bool WindowsThread::detach() {
BOOL ret = CloseHandle(reinterpret_cast<HANDLE>(data_->handle_));
data_->handle_ = 0;
return (ret == TRUE);
return (ret != 0);
}
void WindowsThread::swap(WindowsThread& o) {

Loading…
Cancel
Save