Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
ee6444ed
Commit
ee6444ed
authored
Nov 05, 2018
by
Rob Earhart
Committed by
Robert Kimball
Nov 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make debug logging threadsafe (#1977)
* Make debug logging threadsafe * Add nil stream comments
parent
feef3e04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
log.cpp
src/ngraph/log.cpp
+15
-1
No files found.
src/ngraph/log.cpp
View file @
ee6444ed
...
...
@@ -28,9 +28,23 @@
using
namespace
std
;
using
namespace
ngraph
;
namespace
{
class
NilStreamBuf
final
:
public
streambuf
{
// N.B. We derive from the base streambuf implementation, in
// which underflow() and overflow() both return
// Traits::eof() -- any access returns a failure.
};
}
ostream
&
ngraph
::
get_nil_stream
()
{
static
stringstream
nil
;
// N.B. When debug logging is disabled, multiple threads may
// access the nil stream simultaneously, so it's important to
// return a threadsafe nil stream implementation.
static
NilStreamBuf
nil_buf
;
static
ostream
nil
{
&
nil_buf
};
return
nil
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment