mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
benchmarks: g_thread_create() is deprecated in GLib master, use g_thread_try_new() instead
This commit is contained in:
parent
1f14a425d0
commit
a8b79513c1
3 changed files with 17 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
#include "gst/glib-compat-private.h"
|
||||||
|
|
||||||
#define MAX_THREADS 1000
|
#define MAX_THREADS 1000
|
||||||
|
|
||||||
|
@ -95,7 +96,12 @@ main (gint argc, gchar * argv[])
|
||||||
for (t = 0; t < num_threads; t++) {
|
for (t = 0; t < num_threads; t++) {
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 31, 0)
|
||||||
threads[t] = g_thread_create (run_test, GINT_TO_POINTER (t), TRUE, &error);
|
threads[t] = g_thread_create (run_test, GINT_TO_POINTER (t), TRUE, &error);
|
||||||
|
#else
|
||||||
|
threads[t] = g_thread_try_new ("bufferstresstest", run_test,
|
||||||
|
GINT_TO_POINTER (t), &error);
|
||||||
|
#endif
|
||||||
if (error) {
|
if (error) {
|
||||||
printf ("ERROR: g_thread_create() %s\n", error->message);
|
printf ("ERROR: g_thread_create() %s\n", error->message);
|
||||||
exit (-1);
|
exit (-1);
|
||||||
|
|
|
@ -65,7 +65,12 @@ main (gint argc, gchar * argv[])
|
||||||
for (t = 0; t < num_threads; t++) {
|
for (t = 0; t < num_threads; t++) {
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 31, 0)
|
||||||
threads[t] = g_thread_create (run_test, sysclock, TRUE, &error);
|
threads[t] = g_thread_create (run_test, sysclock, TRUE, &error);
|
||||||
|
#else
|
||||||
|
threads[t] = g_thread_try_new ("clockstresstest", run_test,
|
||||||
|
sysclock, &error);
|
||||||
|
#endif
|
||||||
if (error) {
|
if (error) {
|
||||||
printf ("ERROR: g_thread_create() %s\n", error->message);
|
printf ("ERROR: g_thread_create() %s\n", error->message);
|
||||||
exit (-1);
|
exit (-1);
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
#include "gst/glib-compat-private.h"
|
||||||
|
|
||||||
static GstPoll *set;
|
static GstPoll *set;
|
||||||
static GList *fds = NULL;
|
static GList *fds = NULL;
|
||||||
|
@ -159,7 +160,12 @@ main (gint argc, gchar * argv[])
|
||||||
for (t = 0; t < num_threads; t++) {
|
for (t = 0; t < num_threads; t++) {
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 31, 0)
|
||||||
threads[t] = g_thread_create (run_test, GINT_TO_POINTER (t), TRUE, &error);
|
threads[t] = g_thread_create (run_test, GINT_TO_POINTER (t), TRUE, &error);
|
||||||
|
#else
|
||||||
|
threads[t] = g_thread_try_new ("pollstresstest", run_test,
|
||||||
|
GINT_TO_POINTER (t), &error);
|
||||||
|
#endif
|
||||||
if (error) {
|
if (error) {
|
||||||
printf ("ERROR: g_thread_create() %s\n", error->message);
|
printf ("ERROR: g_thread_create() %s\n", error->message);
|
||||||
exit (-1);
|
exit (-1);
|
||||||
|
|
Loading…
Reference in a new issue