libcw
d
version 2.0.0
The C++ Debugging Support Library
Loading...
Searching...
No Matches
set_ostream.inl.h
1
// SPDX-FileCopyrightText: 2002-2004, 2018-2020, 2026 Carlo Wood
2
// SPDX-License-Identifier: MIT
3
4
#pragma once
5
6
#ifndef LIBCWD_SET_OSTREAM_INL
7
#define LIBCWD_SET_OSTREAM_INL
8
9
#include "
private/LockInterface.h
"
10
11
namespace
libcwd
{
12
36
template
<
class
T>
37
void
DebugObject::set_ostream
(std::ostream* os, T* mutex)
38
{
39
_private_::LockInterfaceBase* new_mutex =
new
_private_::LockInterface<T>(mutex);
40
_private_::LockInterfaceBase* old_mutex;
41
old_mutex = ostream_state_.replace_with(os, new_mutex);
42
// Delete old_mutex after unlocking in order to avoid a dead lock in case the delete causes debug output.
43
if
(old_mutex)
44
delete
old_mutex;
45
}
46
47
}
// namespace libcwd
48
49
#endif
// LIBCWD_SET_OSTREAM_INL
LockInterface.h
libcwd::DebugObject::set_ostream
void set_ostream(std::ostream *os)
Set output device (single threaded applications).
Definition
debug.cxx:1601
libcwd
namespace for libcwd.
libcwd
set_ostream.inl.h
Copyright © 2001-2004, 2026 Carlo Wood. All rights reserved. Generated by
1.16.1.