//=== is guaranteed to work on *all* Win32 variants.
//===----------------------------------------------------------------------===//
-#include "Windows.h"
+#include "WindowsSupport.h"
namespace llvm {
using namespace sys;
}
RWMutexImpl::~RWMutexImpl() {
- if (sHasSRW) {
- // Nothing to do in the case of slim reader/writers
- } else {
+ if (!sHasSRW)
DeleteCriticalSection(static_cast<LPCRITICAL_SECTION>(data_));
- free(data_);
- }
+ // Nothing to do in the case of slim reader/writers except free the memory.
+ free(data_);
}
bool RWMutexImpl::reader_acquire() {