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
eebb921c
Unverified
Commit
eebb921c
authored
Nov 13, 2020
by
Gabi Melman
Committed by
GitHub
Nov 13, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1735 from o2gy84/v1.x
Ability to get size of messages queue of async thread pool
parents
18e3f07f
e17ee87f
Changes
3
Show 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 @
eebb921c
...
@@ -110,6 +110,12 @@ public:
...
@@ -110,6 +110,12 @@ public:
return
q_
.
overrun_counter
();
return
q_
.
overrun_counter
();
}
}
size_t
size
()
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
queue_mutex_
);
return
q_
.
size
();
}
private:
private:
std
::
mutex
queue_mutex_
;
std
::
mutex
queue_mutex_
;
std
::
condition_variable
push_cv_
;
std
::
condition_variable
push_cv_
;
...
...
include/spdlog/details/thread_pool-inl.h
View file @
eebb921c
...
@@ -68,6 +68,11 @@ size_t SPDLOG_INLINE thread_pool::overrun_counter()
...
@@ -68,6 +68,11 @@ size_t SPDLOG_INLINE thread_pool::overrun_counter()
return
q_
.
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
)
void
SPDLOG_INLINE
thread_pool
::
post_async_msg_
(
async_msg
&&
new_msg
,
async_overflow_policy
overflow_policy
)
{
{
if
(
overflow_policy
==
async_overflow_policy
::
block
)
if
(
overflow_policy
==
async_overflow_policy
::
block
)
...
...
include/spdlog/details/thread_pool.h
View file @
eebb921c
...
@@ -97,6 +97,7 @@ public:
...
@@ -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_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
);
void
post_flush
(
async_logger_ptr
&&
worker_ptr
,
async_overflow_policy
overflow_policy
);
size_t
overrun_counter
();
size_t
overrun_counter
();
size_t
queue_size
();
private:
private:
q_type
q_
;
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