[gnome-builder] task: remove ide_task_run_in_thread_sync()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] task: remove ide_task_run_in_thread_sync()
- Date: Wed, 21 Mar 2018 06:18:30 +0000 (UTC)
commit 9f1ae2725a16d3b125482e621259d915c84862f0
Author: Christian Hergert <chergert redhat com>
Date: Tue Mar 20 23:17:19 2018 -0700
task: remove ide_task_run_in_thread_sync()
This wasn't exactly able to handle all situations, so we removed
our use of it in Builder (which is better anyway). So now remove
this so we don't accidentally start relying on it in the future.
src/libide/threading/ide-task.c | 23 -----------------------
src/libide/threading/ide-task.h | 3 ---
src/tests/test-ide-task.c | 26 --------------------------
3 files changed, 52 deletions(-)
---
diff --git a/src/libide/threading/ide-task.c b/src/libide/threading/ide-task.c
index 2806d555c..afd226acb 100644
--- a/src/libide/threading/ide-task.c
+++ b/src/libide/threading/ide-task.c
@@ -1411,29 +1411,6 @@ unlock:
ide_task_return_error (self, g_steal_pointer (&error));
}
-/**
- * ide_task_run_in_thread_sync: (skip)
- */
-void
-ide_task_run_in_thread_sync (IdeTask *self,
- IdeTaskThreadFunc thread_func)
-{
- IdeTaskPrivate *priv = ide_task_get_instance_private (self);
- g_autoptr(GMainContext) main_context = NULL;
-
- g_return_if_fail (IDE_IS_TASK (self));
- g_return_if_fail (thread_func != NULL);
-
- g_mutex_lock (&priv->mutex);
- main_context = g_main_context_ref (priv->main_context);
- g_mutex_unlock (&priv->mutex);
-
- ide_task_run_in_thread (self, thread_func);
-
- while (!ide_task_get_completed (self))
- g_main_context_iteration (main_context, TRUE);
-}
-
static IdeTaskResult *
ide_task_propagate_locked (IdeTask *self,
IdeTaskResultType expected_type,
diff --git a/src/libide/threading/ide-task.h b/src/libide/threading/ide-task.h
index 318b91d43..1b8ece10a 100644
--- a/src/libide/threading/ide-task.h
+++ b/src/libide/threading/ide-task.h
@@ -125,9 +125,6 @@ IDE_AVAILABLE_IN_3_28
void ide_task_run_in_thread (IdeTask *self,
IdeTaskThreadFunc thread_func);
IDE_AVAILABLE_IN_3_28
-void ide_task_run_in_thread_sync (IdeTask *self,
- IdeTaskThreadFunc thread_func);
-IDE_AVAILABLE_IN_3_28
void ide_task_set_check_cancellable (IdeTask *self,
gboolean check_cancellable);
IDE_AVAILABLE_IN_3_28
diff --git a/src/tests/test-ide-task.c b/src/tests/test-ide-task.c
index 03f0aeda1..08fe7febe 100644
--- a/src/tests/test-ide-task.c
+++ b/src/tests/test-ide-task.c
@@ -672,31 +672,6 @@ test_ide_task_report_new_error (void)
g_main_loop_run (main_loop);
}
-static void
-test_ide_task_run_in_thread_sync_cb (IdeTask *task,
- gpointer source_object,
- gpointer task_data,
- GCancellable *cancellable)
-{
- g_assert (IDE_IS_TASK (task));
- g_assert_null (source_object);
- g_assert_null (task_data);
- g_assert_null (cancellable);
-
- ide_task_return_int (task, 774);
-}
-
-static void
-test_ide_task_run_in_thread_sync (void)
-{
- g_autoptr(IdeTask) task = ide_task_new (NULL, NULL, NULL, NULL);
- g_autoptr(GError) error = NULL;
-
- ide_task_run_in_thread_sync (task, test_ide_task_run_in_thread_sync_cb);
- g_assert_cmpint (774, ==, ide_task_propagate_int (task, &error));
- g_assert_no_error (error);
-}
-
gint
main (gint argc,
gchar *argv[])
@@ -729,7 +704,6 @@ main (gint argc,
g_test_add_func ("/Ide/Task/check-cancellable", test_ide_task_check_cancellable);
g_test_add_func ("/Ide/Task/return-on-cancel", test_ide_task_return_on_cancel);
g_test_add_func ("/Ide/Task/report-new-error", test_ide_task_report_new_error);
- g_test_add_func ("/Ide/Task/run-in-thread-sync", test_ide_task_run_in_thread_sync);
return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]