Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
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
spdlog
Commits
aa0f6229
Commit
aa0f6229
authored
Aug 20, 2016
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed dist_sink in gcc
parent
916a686f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
dist_sink.h
include/spdlog/sinks/dist_sink.h
+5
-4
No files found.
include/spdlog/sinks/dist_sink.h
View file @
aa0f6229
...
...
@@ -11,6 +11,7 @@
#include <spdlog/sinks/sink.h>
#include <algorithm>
#include <mutex>
#include <memory>
#include <vector>
...
...
@@ -23,7 +24,7 @@ namespace sinks
template
<
class
Mutex
>
class
dist_sink
:
public
base_sink
<
Mutex
>
{
public
:
public
:
explicit
dist_sink
()
:
_sinks
()
{}
dist_sink
(
const
dist_sink
&
)
=
delete
;
dist_sink
&
operator
=
(
const
dist_sink
&
)
=
delete
;
...
...
@@ -42,20 +43,20 @@ protected:
public
:
void
flush
()
override
{
std
::
lock_guard
<
Mutex
>
lock
(
_mutex
);
std
::
lock_guard
<
Mutex
>
lock
(
base_sink
<
Mutex
>::
_mutex
);
for
(
auto
&
sink
:
_sinks
)
sink
->
flush
();
}
void
add_sink
(
std
::
shared_ptr
<
sink
>
sink
)
{
std
::
lock_guard
<
Mutex
>
lock
(
_mutex
);
std
::
lock_guard
<
Mutex
>
lock
(
base_sink
<
Mutex
>::
_mutex
);
_sinks
.
push_back
(
sink
);
}
void
remove_sink
(
std
::
shared_ptr
<
sink
>
sink
)
{
std
::
lock_guard
<
Mutex
>
lock
(
_mutex
);
std
::
lock_guard
<
Mutex
>
lock
(
base_sink
<
Mutex
>::
_mutex
);
_sinks
.
erase
(
std
::
remove
(
_sinks
.
begin
(),
_sinks
.
end
(),
sink
),
_sinks
.
end
());
}
};
...
...
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