Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
e17ee87f
Commit
e17ee87f
authored
Nov 13, 2020
by
Могилин Виктор
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ability to get size of messages queue of async thread pool
parent
18e3f07f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
include/spdlog/details/mpmc_blocking_q.h
include/spdlog/details/mpmc_blocking_q.h
+6
-0
include/spdlog/details/thread_pool-inl.h
include/spdlog/details/thread_pool-inl.h
+5
-0
include/spdlog/details/thread_pool.h
include/spdlog/details/thread_pool.h
+1
-0
No files found.
include/spdlog/details/mpmc_blocking_q.h
View file @
e17ee87f
...
...
@@ -110,6 +110,12 @@ public:
return
q_
.
overrun_counter
();
}
size_t
size
()
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
queue_mutex_
);
return
q_
.
size
();
}
private:
std
::
mutex
queue_mutex_
;
std
::
condition_variable
push_cv_
;
...
...
include/spdlog/details/thread_pool-inl.h
View file @
e17ee87f
...
...
@@ -68,6 +68,11 @@ size_t SPDLOG_INLINE thread_pool::overrun_counter()
return
q_
.
overrun_counter
();
}
size_t
SPDLOG_INLINE
thread_pool
::
queue_size
()
{
return
q_
.
size
();
}
void
SPDLOG_INLINE
thread_pool
::
post_async_msg_
(
async_msg
&&
new_msg
,
async_overflow_policy
overflow_policy
)
{
if
(
overflow_policy
==
async_overflow_policy
::
block
)
...
...
include/spdlog/details/thread_pool.h
View file @
e17ee87f
...
...
@@ -97,6 +97,7 @@ public:
void
post_log
(
async_logger_ptr
&&
worker_ptr
,
const
details
::
log_msg
&
msg
,
async_overflow_policy
overflow_policy
);
void
post_flush
(
async_logger_ptr
&&
worker_ptr
,
async_overflow_policy
overflow_policy
);
size_t
overrun_counter
();
size_t
queue_size
();
private:
q_type
q_
;
...
...
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