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
a4a13a38
Commit
a4a13a38
authored
Apr 17, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use g_thread_new() if GLib is recent enough
Fixes deprecation warnings.
parent
a28df612
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
9 deletions
+26
-9
DecoderThread.cxx
src/DecoderThread.cxx
+5
-2
IOThread.cxx
src/IOThread.cxx
+7
-3
OutputThread.cxx
src/OutputThread.cxx
+5
-2
PlayerThread.cxx
src/PlayerThread.cxx
+4
-0
UpdateGlue.cxx
src/UpdateGlue.cxx
+5
-2
No files found.
src/DecoderThread.cxx
View file @
a4a13a38
...
...
@@ -494,13 +494,16 @@ decoder_task(gpointer arg)
void
decoder_thread_start
(
struct
decoder_control
*
dc
)
{
GError
*
e
=
NULL
;
assert
(
dc
->
thread
==
NULL
);
dc
->
quit
=
false
;
#if GLIB_CHECK_VERSION(2,32,0)
dc
->
thread
=
g_thread_new
(
"thread"
,
decoder_task
,
dc
);
#else
GError
*
e
=
NULL
;
dc
->
thread
=
g_thread_create
(
decoder_task
,
dc
,
true
,
&
e
);
if
(
dc
->
thread
==
NULL
)
MPD_ERROR
(
"Failed to spawn decoder task: %s"
,
e
->
message
);
#endif
}
src/IOThread.cxx
View file @
a4a13a38
...
...
@@ -64,16 +64,20 @@ io_thread_init(void)
}
bool
io_thread_start
(
GError
**
error_r
)
io_thread_start
(
gcc_unused
GError
**
error_r
)
{
assert
(
io
.
loop
!=
NULL
);
assert
(
io
.
thread
==
NULL
);
io
.
mutex
.
lock
();
const
ScopeLock
protect
(
io
.
mutex
);
#if GLIB_CHECK_VERSION(2,32,0)
io
.
thread
=
g_thread_new
(
"io"
,
io_thread_func
,
nullptr
);
#else
io
.
thread
=
g_thread_create
(
io_thread_func
,
NULL
,
true
,
error_r
);
io
.
mutex
.
unlock
();
if
(
io
.
thread
==
NULL
)
return
false
;
#endif
return
true
;
}
...
...
src/OutputThread.cxx
View file @
a4a13a38
...
...
@@ -673,10 +673,13 @@ static gpointer audio_output_task(gpointer arg)
void
audio_output_thread_start
(
struct
audio_output
*
ao
)
{
GError
*
e
=
NULL
;
assert
(
ao
->
command
==
AO_COMMAND_NONE
);
#if GLIB_CHECK_VERSION(2,32,0)
ao
->
thread
=
g_thread_new
(
"output"
,
audio_output_task
,
ao
);
#else
GError
*
e
=
nullptr
;
if
(
!
(
ao
->
thread
=
g_thread_create
(
audio_output_task
,
ao
,
true
,
&
e
)))
MPD_ERROR
(
"Failed to spawn output task: %s
\n
"
,
e
->
message
);
#endif
}
src/PlayerThread.cxx
View file @
a4a13a38
...
...
@@ -1202,8 +1202,12 @@ player_create(struct player_control *pc)
{
assert
(
pc
->
thread
==
NULL
);
#if GLIB_CHECK_VERSION(2,32,0)
pc
->
thread
=
g_thread_new
(
"player"
,
player_task
,
pc
);
#else
GError
*
e
=
NULL
;
pc
->
thread
=
g_thread_create
(
player_task
,
pc
,
true
,
&
e
);
if
(
pc
->
thread
==
NULL
)
MPD_ERROR
(
"Failed to spawn player task: %s"
,
e
->
message
);
#endif
}
src/UpdateGlue.cxx
View file @
a4a13a38
...
...
@@ -99,16 +99,19 @@ static void * update_task(void *_path)
static
void
spawn_update_task
(
const
char
*
path
)
{
GError
*
e
=
NULL
;
assert
(
g_thread_self
()
==
main_task
);
progress
=
UPDATE_PROGRESS_RUNNING
;
modified
=
false
;
#if GLIB_CHECK_VERSION(2,32,0)
update_thr
=
g_thread_new
(
"updadte"
,
update_task
,
g_strdup
(
path
));
#else
GError
*
e
=
NULL
;
update_thr
=
g_thread_create
(
update_task
,
g_strdup
(
path
),
TRUE
,
&
e
);
if
(
update_thr
==
NULL
)
MPD_ERROR
(
"Failed to spawn update task: %s"
,
e
->
message
);
#endif
if
(
++
update_task_id
>
update_task_id_max
)
update_task_id
=
1
;
...
...
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