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
195cec50
Commit
195cec50
authored
Dec 28, 2008
by
Thomas Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player_thread: migrate from pthread to glib threads
parent
c01ad37d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
player_thread.c
src/player_thread.c
+6
-8
No files found.
src/player_thread.c
View file @
195cec50
...
@@ -493,7 +493,7 @@ static void do_play(void)
...
@@ -493,7 +493,7 @@ static void do_play(void)
player_stop_decoder
();
player_stop_decoder
();
}
}
static
void
*
player_task
(
G_GNUC_UNUSED
void
*
arg
)
static
gpointer
player_task
(
G_GNUC_UNUSED
gpointer
arg
)
{
{
while
(
1
)
{
while
(
1
)
{
switch
(
pc
.
command
)
{
switch
(
pc
.
command
)
{
...
@@ -517,7 +517,7 @@ static void * player_task(G_GNUC_UNUSED void *arg)
...
@@ -517,7 +517,7 @@ static void * player_task(G_GNUC_UNUSED void *arg)
dc_quit
(
&
pc
.
notify
);
dc_quit
(
&
pc
.
notify
);
closeAudioDevice
();
closeAudioDevice
();
player_command_finished
();
player_command_finished
();
p
thread_exit
(
NULL
);
g_
thread_exit
(
NULL
);
break
;
break
;
case
PLAYER_COMMAND_CANCEL
:
case
PLAYER_COMMAND_CANCEL
:
...
@@ -535,11 +535,9 @@ static void * player_task(G_GNUC_UNUSED void *arg)
...
@@ -535,11 +535,9 @@ static void * player_task(G_GNUC_UNUSED void *arg)
void
player_create
(
void
)
void
player_create
(
void
)
{
{
pthread_attr_t
attr
;
GError
*
e
;
pthread_t
player_thread
;
GThread
*
t
;
pthread_attr_init
(
&
attr
);
if
(
!
(
t
=
g_thread_create
(
player_task
,
NULL
,
FALSE
,
&
e
)))
pthread_attr_setdetachstate
(
&
attr
,
PTHREAD_CREATE_DETACHED
);
FATAL
(
"Failed to spawn player task: %s
\n
"
,
e
->
message
);
if
(
pthread_create
(
&
player_thread
,
&
attr
,
player_task
,
NULL
))
FATAL
(
"Failed to spawn player task: %s
\n
"
,
strerror
(
errno
));
}
}
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