Don't check that Stdin/Stdout/Stderr are unlocked on exit.
This commit is contained in:
parent
0787c642ce
commit
c1a16acd53
@ -24,7 +24,8 @@ namespace td {
|
|||||||
template <int id>
|
template <int id>
|
||||||
static FileFd &get_file_fd() {
|
static FileFd &get_file_fd() {
|
||||||
static FileFd result = FileFd::from_native_fd(NativeFd(id, true));
|
static FileFd result = FileFd::from_native_fd(NativeFd(id, true));
|
||||||
static auto guard = ScopeExit() + [&] {
|
static ExitGuard exit_guard;
|
||||||
|
static auto guard = SCOPE_EXIT {
|
||||||
result.move_as_native_fd().release();
|
result.move_as_native_fd().release();
|
||||||
};
|
};
|
||||||
return result;
|
return result;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "td/utils/common.h"
|
#include "td/utils/common.h"
|
||||||
|
#include "td/utils/ExitGuard.h"
|
||||||
#include "td/utils/format.h"
|
#include "td/utils/format.h"
|
||||||
#include "td/utils/List.h"
|
#include "td/utils/List.h"
|
||||||
#include "td/utils/logging.h"
|
#include "td/utils/logging.h"
|
||||||
@ -124,8 +125,10 @@ class PollableFdInfo : private ListNode {
|
|||||||
|
|
||||||
~PollableFdInfo() {
|
~PollableFdInfo() {
|
||||||
VLOG(fd) << native_fd() << " destroy PollableFdInfo";
|
VLOG(fd) << native_fd() << " destroy PollableFdInfo";
|
||||||
bool was_locked = lock_.test_and_set(std::memory_order_acquire);
|
if (!ExitGuard::is_exited()) {
|
||||||
CHECK(!was_locked);
|
bool was_locked = lock_.test_and_set(std::memory_order_acquire);
|
||||||
|
CHECK(!was_locked);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_flags_from_poll(PollFlags flags) {
|
void add_flags_from_poll(PollFlags flags) {
|
||||||
|
Loading…
Reference in New Issue
Block a user