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
18076ac9
Commit
18076ac9
authored
Jan 10, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PlayerThread: use pc.cond instead of main_cond
The main_cond variable was completely unnecessary. The pc.cond object can be used for both main->pc and pc->main.
parent
ad15ca71
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
8 deletions
+2
-8
Main.cxx
src/Main.cxx
+0
-4
Main.hxx
src/Main.hxx
+0
-2
PlayerControl.cxx
src/PlayerControl.cxx
+1
-1
PlayerThread.cxx
src/PlayerThread.cxx
+1
-1
No files found.
src/Main.cxx
View file @
18076ac9
...
@@ -98,8 +98,6 @@ enum {
...
@@ -98,8 +98,6 @@ enum {
GThread
*
main_task
;
GThread
*
main_task
;
GMainLoop
*
main_loop
;
GMainLoop
*
main_loop
;
GCond
*
main_cond
;
Partition
*
global_partition
;
Partition
*
global_partition
;
static
bool
static
bool
...
@@ -404,7 +402,6 @@ int mpd_main(int argc, char *argv[])
...
@@ -404,7 +402,6 @@ int mpd_main(int argc, char *argv[])
main_task
=
g_thread_self
();
main_task
=
g_thread_self
();
main_loop
=
g_main_loop_new
(
NULL
,
FALSE
);
main_loop
=
g_main_loop_new
(
NULL
,
FALSE
);
main_cond
=
g_cond_new
();
GlobalEvents
::
Initialize
();
GlobalEvents
::
Initialize
();
GlobalEvents
::
Register
(
GlobalEvents
::
IDLE
,
idle_event_emitted
);
GlobalEvents
::
Register
(
GlobalEvents
::
IDLE
,
idle_event_emitted
);
...
@@ -536,7 +533,6 @@ int mpd_main(int argc, char *argv[])
...
@@ -536,7 +533,6 @@ int mpd_main(int argc, char *argv[])
sticker_global_finish
();
sticker_global_finish
();
#endif
#endif
g_cond_free
(
main_cond
);
GlobalEvents
::
Deinitialize
();
GlobalEvents
::
Deinitialize
();
playlist_list_global_finish
();
playlist_list_global_finish
();
...
...
src/Main.hxx
View file @
18076ac9
...
@@ -26,8 +26,6 @@ extern GThread *main_task;
...
@@ -26,8 +26,6 @@ extern GThread *main_task;
extern
GMainLoop
*
main_loop
;
extern
GMainLoop
*
main_loop
;
extern
GCond
*
main_cond
;
extern
struct
Partition
*
global_partition
;
extern
struct
Partition
*
global_partition
;
/**
/**
...
...
src/PlayerControl.cxx
View file @
18076ac9
...
@@ -76,7 +76,7 @@ static void
...
@@ -76,7 +76,7 @@ static void
player_command_wait_locked
(
struct
player_control
*
pc
)
player_command_wait_locked
(
struct
player_control
*
pc
)
{
{
while
(
pc
->
command
!=
PLAYER_COMMAND_NONE
)
while
(
pc
->
command
!=
PLAYER_COMMAND_NONE
)
g_cond_wait
(
main_
cond
,
pc
->
mutex
);
g_cond_wait
(
pc
->
cond
,
pc
->
mutex
);
}
}
static
void
static
void
...
...
src/PlayerThread.cxx
View file @
18076ac9
...
@@ -147,7 +147,7 @@ player_command_finished_locked(struct player_control *pc)
...
@@ -147,7 +147,7 @@ player_command_finished_locked(struct player_control *pc)
assert
(
pc
->
command
!=
PLAYER_COMMAND_NONE
);
assert
(
pc
->
command
!=
PLAYER_COMMAND_NONE
);
pc
->
command
=
PLAYER_COMMAND_NONE
;
pc
->
command
=
PLAYER_COMMAND_NONE
;
g_cond_signal
(
main_
cond
);
g_cond_signal
(
pc
->
cond
);
}
}
static
void
static
void
...
...
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