Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
d989dbfe
Commit
d989dbfe
authored
Jan 08, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thread/Thread: make IsInside() debug-only
This method is only used inside assert().
parent
ca9fcec3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
IOThread.cxx
src/IOThread.cxx
+4
-0
IOThread.hxx
src/IOThread.hxx
+5
-0
Thread.hxx
src/thread/Thread.hxx
+2
-0
No files found.
src/IOThread.cxx
View file @
d989dbfe
...
...
@@ -108,8 +108,12 @@ io_thread_get() noexcept
return
*
io
.
loop
;
}
#ifndef NDEBUG
bool
io_thread_inside
()
noexcept
{
return
io
.
thread
.
IsInside
();
}
#endif
src/IOThread.hxx
View file @
d989dbfe
...
...
@@ -20,6 +20,7 @@
#ifndef MPD_IO_THREAD_HXX
#define MPD_IO_THREAD_HXX
#include "check.h"
#include "Compiler.h"
class
EventLoop
;
...
...
@@ -53,6 +54,8 @@ gcc_const
EventLoop
&
io_thread_get
()
noexcept
;
#ifndef NDEBUG
/**
* Is the current thread the I/O thread?
*/
...
...
@@ -61,3 +64,5 @@ bool
io_thread_inside
()
noexcept
;
#endif
#endif
src/thread/Thread.hxx
View file @
d989dbfe
...
...
@@ -64,6 +64,7 @@ public:
#endif
}
#ifndef NDEBUG
/**
* Check if this thread is the current thread.
*/
...
...
@@ -81,6 +82,7 @@ public:
return
pthread_self
()
==
handle
;
#endif
}
#endif
void
Start
();
void
Join
();
...
...
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