diff --git a/libsoup/soup-session-async.c b/libsoup/soup-session-async.c
index 183ccbb..f00169d 100644
--- a/libsoup/soup-session-async.c
+++ b/libsoup/soup-session-async.c
@@ -46,6 +46,7 @@ static void  auth_required   (SoupSession *session, SoupMessage *msg,
 G_DEFINE_TYPE (SoupSessionAsync, soup_session_async, SOUP_TYPE_SESSION)
 
 typedef struct {
+	GMutex *source_lock;
 	GSource *idle_run_queue_source;
 } SoupSessionAsyncPrivate;
 #define SOUP_SESSION_ASYNC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUP_TYPE_SESSION_ASYNC, SoupSessionAsyncPrivate))
@@ -53,6 +54,8 @@ typedef struct {
 static void
 soup_session_async_init (SoupSessionAsync *sa)
 {
+	SoupSessionAsyncPrivate *priv = SOUP_SESSION_ASYNC_GET_PRIVATE (sa);
+	priv->source_lock = g_mutex_new();
 }
 
 static void
@@ -62,6 +65,7 @@ finalize (GObject *object)
 
 	if (priv->idle_run_queue_source)
 		g_source_destroy (priv->idle_run_queue_source);
+	g_mutex_free(priv->source_lock);
 
 	G_OBJECT_CLASS (soup_session_async_parent_class)->finalize (object);
 }
@@ -439,7 +443,10 @@ idle_run_queue (gpointer sa)
 {
 	SoupSessionAsyncPrivate *priv = SOUP_SESSION_ASYNC_GET_PRIVATE (sa);
 
+	g_mutex_lock(priv->source_lock);
 	priv->idle_run_queue_source = NULL;
+	g_mutex_unlock(priv->source_lock);
+
 	run_queue (sa);
 	return FALSE;
 }
@@ -449,11 +456,13 @@ do_idle_run_queue (SoupSession *session)
 {
 	SoupSessionAsyncPrivate *priv = SOUP_SESSION_ASYNC_GET_PRIVATE (session);
 
+	g_mutex_lock(priv->source_lock);
 	if (!priv->idle_run_queue_source) {
 		priv->idle_run_queue_source = soup_add_completion (
 			soup_session_get_async_context (session),
 			idle_run_queue, session);
 	}
+	g_mutex_unlock(priv->source_lock);
 }
 
 static void
