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
32dfc11c
Commit
32dfc11c
authored
Oct 17, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Main: use ThreadId instead of GThread*
parent
aad0ea6e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
Main.cxx
src/Main.cxx
+3
-2
Main.hxx
src/Main.hxx
+2
-2
UpdateGlue.cxx
src/UpdateGlue.cxx
+3
-2
No files found.
src/Main.cxx
View file @
32dfc11c
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
#include "system/FatalError.hxx"
#include "system/FatalError.hxx"
#include "util/Error.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "util/Domain.hxx"
#include "thread/Id.hxx"
#include "ConfigGlobal.hxx"
#include "ConfigGlobal.hxx"
#include "ConfigData.hxx"
#include "ConfigData.hxx"
#include "ConfigDefaults.hxx"
#include "ConfigDefaults.hxx"
...
@@ -99,7 +100,7 @@ enum {
...
@@ -99,7 +100,7 @@ enum {
static
constexpr
Domain
main_domain
(
"main"
);
static
constexpr
Domain
main_domain
(
"main"
);
GThread
*
main_task
;
ThreadId
main_thread
;
EventLoop
*
main_loop
;
EventLoop
*
main_loop
;
Instance
*
instance
;
Instance
*
instance
;
...
@@ -389,7 +390,7 @@ int mpd_main(int argc, char *argv[])
...
@@ -389,7 +390,7 @@ int mpd_main(int argc, char *argv[])
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
}
}
main_t
ask
=
g_thread_self
();
main_t
hread
=
ThreadId
::
GetCurrent
();
main_loop
=
new
EventLoop
(
EventLoop
::
Default
());
main_loop
=
new
EventLoop
(
EventLoop
::
Default
());
instance
=
new
Instance
();
instance
=
new
Instance
();
...
...
src/Main.hxx
View file @
32dfc11c
...
@@ -20,11 +20,11 @@
...
@@ -20,11 +20,11 @@
#ifndef MPD_MAIN_HXX
#ifndef MPD_MAIN_HXX
#define MPD_MAIN_HXX
#define MPD_MAIN_HXX
class
ThreadId
;
class
EventLoop
;
class
EventLoop
;
struct
Instance
;
struct
Instance
;
typedef
struct
_GThread
GThread
;
extern
GThread
*
main_task
;
extern
ThreadId
main_thread
;
extern
EventLoop
*
main_loop
;
extern
EventLoop
*
main_loop
;
...
...
src/UpdateGlue.cxx
View file @
32dfc11c
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include "Main.hxx"
#include "Main.hxx"
#include "Instance.hxx"
#include "Instance.hxx"
#include "system/FatalError.hxx"
#include "system/FatalError.hxx"
#include "thread/Id.hxx"
#include <glib.h>
#include <glib.h>
...
@@ -92,7 +93,7 @@ static void * update_task(void *_path)
...
@@ -92,7 +93,7 @@ static void * update_task(void *_path)
static
void
static
void
spawn_update_task
(
const
char
*
path
)
spawn_update_task
(
const
char
*
path
)
{
{
assert
(
g_thread_self
()
==
main_task
);
assert
(
main_thread
.
IsInside
()
);
progress
=
UPDATE_PROGRESS_RUNNING
;
progress
=
UPDATE_PROGRESS_RUNNING
;
modified
=
false
;
modified
=
false
;
...
@@ -115,7 +116,7 @@ spawn_update_task(const char *path)
...
@@ -115,7 +116,7 @@ spawn_update_task(const char *path)
unsigned
unsigned
update_enqueue
(
const
char
*
path
,
bool
_discard
)
update_enqueue
(
const
char
*
path
,
bool
_discard
)
{
{
assert
(
g_thread_self
()
==
main_task
);
assert
(
main_thread
.
IsInside
()
);
if
(
!
db_is_simple
()
||
!
mapper_has_music_directory
())
if
(
!
db_is_simple
()
||
!
mapper_has_music_directory
())
return
0
;
return
0
;
...
...
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