summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libtracker-common/meson.build1
-rw-r--r--src/libtracker-common/tracker-common.h1
-rw-r--r--src/libtracker-common/tracker-sched.c77
-rw-r--r--src/libtracker-common/tracker-sched.h35
-rw-r--r--tests/libtracker-common/meson.build1
-rw-r--r--tests/libtracker-common/tracker-sched-test.c63
6 files changed, 0 insertions, 178 deletions
diff --git a/src/libtracker-common/meson.build b/src/libtracker-common/meson.build
index 041b7f0b2..60941a078 100644
--- a/src/libtracker-common/meson.build
+++ b/src/libtracker-common/meson.build
@@ -17,7 +17,6 @@ tracker_common_sources = [
'tracker-file-utils.c',
'tracker-ioprio.c',
'tracker-log.c',
- 'tracker-sched.c',
'tracker-type-utils.c',
'tracker-utils.c',
'tracker-locale.c',
diff --git a/src/libtracker-common/tracker-common.h b/src/libtracker-common/tracker-common.h
index 5a97e9894..65a20c2bc 100644
--- a/src/libtracker-common/tracker-common.h
+++ b/src/libtracker-common/tracker-common.h
@@ -36,7 +36,6 @@
#include "tracker-language.h"
#include "tracker-log.h"
#include "tracker-parser.h"
-#include "tracker-sched.h"
#include "tracker-type-utils.h"
#include "tracker-utils.h"
#include "tracker-locale.h"
diff --git a/src/libtracker-common/tracker-sched.c b/src/libtracker-common/tracker-sched.c
deleted file mode 100644
index 15dbbed67..000000000
--- a/src/libtracker-common/tracker-sched.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2011, Nokia <ivan.frade@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#ifdef __linux__
-
-#include <errno.h>
-#include <sched.h>
-
-#include "tracker-sched.h"
-
-gboolean
-tracker_sched_idle (void)
-{
- struct sched_param sp;
-
- /* Set process scheduling parameters:
- * This is used so we don't steal scheduling priority from
- * the most important applications - like the phone
- * application which has a real time requirement here. This
- * is detailed in Nokia bug #95573
- */
- g_message ("Setting scheduler policy to SCHED_IDLE");
-
- if (sched_getparam (0, &sp) == 0) {
- if (sched_setscheduler (0, SCHED_IDLE, &sp) != 0) {
-//LCOV_EXCL_START
- const gchar *str = g_strerror (errno);
-
- g_warning ("Could not set scheduler policy, %s",
- str ? str : "no error given");
-
- return FALSE;
- }
- } else {
- const gchar *str = g_strerror (errno);
-
- g_warning ("Could not get scheduler policy, %s",
- str ? str : "no error given");
-
- return FALSE;
- }
-//LCOV_EXCL_END
-
- return TRUE;
-}
-
-#else /* __linux__ */
-
-#include <glib.h>
-
-#include "tracker-sched.h"
-
-gboolean
-tracker_sched_idle (void)
-{
- return TRUE;
-}
-
-#endif /* __linux__ */
diff --git a/src/libtracker-common/tracker-sched.h b/src/libtracker-common/tracker-sched.h
deleted file mode 100644
index 7f9590e3f..000000000
--- a/src/libtracker-common/tracker-sched.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2011, Nokia <ivan.frade@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef __LIBTRACKER_COMMON_SCHED_H__
-#define __LIBTRACKER_COMMON_SCHED_H__
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-#if !defined (__LIBTRACKER_COMMON_INSIDE__) && !defined (TRACKER_COMPILATION)
-#error "only <libtracker-common/tracker-common.h> must be included directly."
-#endif
-
-gboolean tracker_sched_idle (void);
-
-G_END_DECLS
-
-#endif /* __LIBTRACKER_COMMON_SCHED_H__ */
diff --git a/tests/libtracker-common/meson.build b/tests/libtracker-common/meson.build
index f6618f930..c1e94f879 100644
--- a/tests/libtracker-common/meson.build
+++ b/tests/libtracker-common/meson.build
@@ -2,7 +2,6 @@ libtracker_common_tests = [
'date-time',
'dbus',
'file-utils',
- 'sched',
'type-utils',
'utils',
]
diff --git a/tests/libtracker-common/tracker-sched-test.c b/tests/libtracker-common/tracker-sched-test.c
deleted file mode 100644
index 48bb21d8b..000000000
--- a/tests/libtracker-common/tracker-sched-test.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2011, Nokia <ivan.frade@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "config.h"
-
-#include <glib.h>
-#include <glib-object.h>
-#include <libtracker-common/tracker-sched.h>
-
-#ifdef __linux__
-#include <linux/sched.h>
-#endif
-
-
-#include <sched.h>
-#include <errno.h>
-
-
-static gboolean
-scheduler_is (gint scheduler)
-{
-#ifdef __linux__
- return (sched_getscheduler (0) == scheduler);
-#else
- return TRUE;
-#endif
-}
-
-static void
-test_sched_set_and_get (void)
-{
- g_assert (tracker_sched_idle ());
-#ifdef __linux__
- g_assert (scheduler_is (SCHED_IDLE));
-#endif
-}
-
-
-gint
-main (gint argc, gchar **argv)
-{
- g_test_init (&argc, &argv, NULL);
-
- g_test_add_func ("/libtracker-common/sched/set_and_get",
- test_sched_set_and_get);
-
- return g_test_run ();
-}