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
a0272c2d
Commit
a0272c2d
authored
Sep 24, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notify: added notify_deinit()
Destroy the mutex when it is not used anymore.
parent
ee1d723a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
36 additions
and
0 deletions
+36
-0
decoder_control.c
src/decoder_control.c
+5
-0
decoder_control.h
src/decoder_control.h
+2
-0
main.c
src/main.c
+4
-0
main_notify.c
src/main_notify.c
+8
-0
main_notify.h
src/main_notify.h
+2
-0
notify.c
src/notify.c
+6
-0
notify.h
src/notify.h
+2
-0
player_control.c
src/player_control.c
+5
-0
player_control.h
src/player_control.h
+2
-0
No files found.
src/decoder_control.c
View file @
a0272c2d
...
...
@@ -28,6 +28,11 @@ void dc_init(void)
dc
.
error
=
DECODE_ERROR_NOERROR
;
}
void
dc_deinit
(
void
)
{
notify_deinit
(
&
dc
.
notify
);
}
void
dc_command_wait
(
Notify
*
notify
)
{
while
(
dc
.
command
!=
DECODE_COMMAND_NONE
)
{
...
...
src/decoder_control.h
View file @
a0272c2d
...
...
@@ -58,6 +58,8 @@ extern struct decoder_control dc;
void
dc_init
(
void
);
void
dc_deinit
(
void
);
static
inline
int
decoder_is_idle
(
void
)
{
return
dc
.
state
==
DECODE_STATE_STOP
&&
...
...
src/main.c
View file @
a0272c2d
...
...
@@ -459,12 +459,16 @@ int main(int argc, char *argv[])
DEBUG
(
"closeMp3Directory took %f seconds
\n
"
,
((
float
)(
clock
()
-
start
))
/
CLOCKS_PER_SEC
);
deinit_main_notify
();
finishNormalization
();
finishAudioDriver
();
finishAudioConfig
();
finishVolume
();
finishPaths
();
finishPermissions
();
dc_deinit
();
pc_deinit
();
finishCommands
();
decoder_plugin_deinit_all
();
ob_free
();
...
...
src/main_notify.c
View file @
a0272c2d
...
...
@@ -68,6 +68,14 @@ void init_main_notify(void)
notify_init
(
&
main_notify
);
}
void
deinit_main_notify
(
void
)
{
notify_deinit
(
&
main_notify
);
deregisterIO
(
&
main_notify_IO
);
xclose
(
main_pipe
[
0
]);
xclose
(
main_pipe
[
1
]);
}
static
int
wakeup_via_pipe
(
void
)
{
int
ret
=
pthread_mutex_trylock
(
&
select_mutex
);
...
...
src/main_notify.h
View file @
a0272c2d
...
...
@@ -23,6 +23,8 @@
void
init_main_notify
(
void
);
void
deinit_main_notify
(
void
);
void
wakeup_main_task
(
void
);
void
wait_main_task
(
void
);
...
...
src/notify.c
View file @
a0272c2d
...
...
@@ -34,6 +34,12 @@ void notify_init(struct notify *notify)
notify
->
pending
=
0
;
}
void
notify_deinit
(
struct
notify
*
notify
)
{
pthread_mutex_destroy
(
&
notify
->
mutex
);
pthread_cond_destroy
(
&
notify
->
cond
);
}
void
notify_enter
(
struct
notify
*
notify
)
{
pthread_mutex_lock
(
&
notify
->
mutex
);
...
...
src/notify.h
View file @
a0272c2d
...
...
@@ -29,6 +29,8 @@ typedef struct notify {
void
notify_init
(
struct
notify
*
notify
);
void
notify_deinit
(
struct
notify
*
notify
);
/**
* The thread which shall be notified by this object must call this
* function before any notify_wait() invocation. It locks the mutex.
...
...
src/player_control.c
View file @
a0272c2d
...
...
@@ -38,6 +38,11 @@ void pc_init(unsigned int buffered_before_play)
pc
.
softwareVolume
=
1000
;
}
void
pc_deinit
(
void
)
{
notify_deinit
(
&
pc
.
notify
);
}
static
void
set_current_song
(
Song
*
song
)
{
assert
(
song
!=
NULL
);
...
...
src/player_control.h
View file @
a0272c2d
...
...
@@ -107,6 +107,8 @@ extern struct player_control pc;
void
pc_init
(
unsigned
int
buffered_before_play
);
void
pc_deinit
(
void
);
void
playerPlay
(
Song
*
song
);
void
playerSetPause
(
int
pause_flag
);
...
...
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