Summary:
ScopeGuard::execute will already call std::terminate if an
exception is thrown, as it's noexcept, and the case in
ConcurrentSkipList should be a check.
Test Plan:
Ran folly tests. Will look at phabricator to see if
anything breaks downstream from removing glog/logging.h from
scopeguard.
Reviewed By: chip@fb.com
FB internal diff:
D677038
/*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
//===================================================================
~ConcurrentSkipList() {
- LOG_IF(FATAL, recycler_.refs() > 0)
- << "number of accessors is not 0, " << recycler_.refs() << " instead!"
- << " This shouldn't have happened!";
+ CHECK_EQ(recycler_.refs(), 0);
while (NodeType* current = head_.load(std::memory_order_relaxed)) {
NodeType* tmp = current->skip(0);
NodeType::destroy(current);
/*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <cstddef>
#include <functional>
#include <new>
-#include <glog/logging.h>
#include "folly/Preprocessor.h"
private:
void* operator new(size_t) = delete;
- void execute() noexcept {
- try {
- function_();
- } catch (const std::exception& ex) {
- LOG(FATAL) << "ScopeGuard cleanup function threw a " <<
- typeid(ex).name() << "exception: " << ex.what();
- } catch (...) {
- LOG(FATAL) << "ScopeGuard cleanup function threw a non-exception object";
- }
- }
+ void execute() noexcept { function_(); }
FunctionType function_;
};
/*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <gflags/gflags.h>
#include <gtest/gtest.h>
+#include <glog/logging.h>
#include <functional>
#include <stdexcept>