src/io.cpp: Fix uninitialized variable.
`std::atomic<bool>` does not default initialize to `false`. Bug: #12
This commit is contained in:
parent
93b861004e
commit
96b25aafe0
@ -130,7 +130,6 @@ class File : public dap::ReaderWriter {
|
|||||||
out[i] = char(c);
|
out[i] = char(c);
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
// return fread(buffer, 1, n, f);
|
|
||||||
}
|
}
|
||||||
bool write(const void* buffer, size_t n) override {
|
bool write(const void* buffer, size_t n) override {
|
||||||
std::unique_lock<std::mutex> lock(writeMutex);
|
std::unique_lock<std::mutex> lock(writeMutex);
|
||||||
@ -143,10 +142,10 @@ class File : public dap::ReaderWriter {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
FILE* const f;
|
FILE* const f;
|
||||||
|
const bool closable;
|
||||||
std::mutex readMutex;
|
std::mutex readMutex;
|
||||||
std::mutex writeMutex;
|
std::mutex writeMutex;
|
||||||
std::atomic<bool> closed;
|
std::atomic<bool> closed = { false };
|
||||||
const bool closable;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ReaderSpy : public dap::Reader {
|
class ReaderSpy : public dap::Reader {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user