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
65dfd901
Commit
65dfd901
authored
Sep 16, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/soup: move libsoup calls to the I/O thread
libsoup's asynchronous API is not thread safe. By moving the calls into the I/O thread, several crash bugs will be fixed.
parent
59abdbd2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
soup_input_plugin.c
src/input/soup_input_plugin.c
+25
-4
No files found.
src/input/soup_input_plugin.c
View file @
65dfd901
...
@@ -220,6 +220,17 @@ input_soup_wait_data(struct input_soup *s)
...
@@ -220,6 +220,17 @@ input_soup_wait_data(struct input_soup *s)
}
}
}
}
static
gpointer
input_soup_queue
(
gpointer
data
)
{
struct
input_soup
*
s
=
data
;
soup_session_queue_message
(
soup_session
,
s
->
msg
,
input_soup_session_callback
,
s
);
return
NULL
;
}
static
struct
input_stream
*
static
struct
input_stream
*
input_soup_open
(
const
char
*
uri
,
G_GNUC_UNUSED
GError
**
error_r
)
input_soup_open
(
const
char
*
uri
,
G_GNUC_UNUSED
GError
**
error_r
)
{
{
...
@@ -255,12 +266,23 @@ input_soup_open(const char *uri, G_GNUC_UNUSED GError **error_r)
...
@@ -255,12 +266,23 @@ input_soup_open(const char *uri, G_GNUC_UNUSED GError **error_r)
s
->
completed
=
false
;
s
->
completed
=
false
;
s
->
postponed_error
=
NULL
;
s
->
postponed_error
=
NULL
;
soup_session_queue_message
(
soup_session
,
s
->
msg
,
io_thread_call
(
input_soup_queue
,
s
);
input_soup_session_callback
,
s
);
return
&
s
->
base
;
return
&
s
->
base
;
}
}
static
gpointer
input_soup_cancel
(
gpointer
data
)
{
struct
input_soup
*
s
=
data
;
if
(
!
s
->
completed
)
soup_session_cancel_message
(
soup_session
,
s
->
msg
,
SOUP_STATUS_CANCELLED
);
return
NULL
;
}
static
void
static
void
input_soup_close
(
struct
input_stream
*
is
)
input_soup_close
(
struct
input_stream
*
is
)
{
{
...
@@ -274,8 +296,7 @@ input_soup_close(struct input_stream *is)
...
@@ -274,8 +296,7 @@ input_soup_close(struct input_stream *is)
g_mutex_unlock
(
s
->
mutex
);
g_mutex_unlock
(
s
->
mutex
);
soup_session_cancel_message
(
soup_session
,
s
->
msg
,
io_thread_call
(
input_soup_cancel
,
s
);
SOUP_STATUS_CANCELLED
);
g_mutex_lock
(
s
->
mutex
);
g_mutex_lock
(
s
->
mutex
);
while
(
!
s
->
completed
)
while
(
!
s
->
completed
)
...
...
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