Date: Sun, 24 Oct 2004 07:45:23 +0200 (CEST) From: Jean-Yves Lefort <jylefort@brutele.be> To: FreeBSD-gnats-submit@FreeBSD.org Cc: gnome@FreeBSD.org Subject: ports/73060: Update port: devel/glib20 (fix POSIX threads) Message-ID: <20041024054523.9FDEB22E09@jsite.lefort.net> Resent-Message-ID: <200410240550.i9O5oQaH037785@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 73060 >Category: ports >Synopsis: Update port: devel/glib20 (fix POSIX threads) >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Oct 24 05:50:26 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Jean-Yves Lefort >Release: FreeBSD 5.3-BETA6 i386 >Organization: >Environment: System: FreeBSD jsite.lefort.net 5.3-BETA6 FreeBSD 5.3-BETA6 #0: Tue Sep 28 00:10:28 CEST 2004 jylefort@jsite.lefort.net:/usr/obj/usr/src/sys/JSITE i386 >Description: When called from a threads-enabled Perl, g_thread_init() aborts, because pthread_getschedparam() fails. This breaks Perl bindings such as Gnome2::GConf, and probably many others. >How-To-Repeat: >Fix: The following patch handles the failure of pthread_getschedparam(). diff -ruN /usr/ports/devel/glib20/Makefile glib20/Makefile --- /usr/ports/devel/glib20/Makefile Tue Oct 12 14:49:29 2004 +++ glib20/Makefile Sun Oct 24 07:02:44 2004 @@ -7,6 +7,7 @@ PORTNAME= glib PORTVERSION= 2.4.7 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_GNOME:S,%SUBDIR%,sources/${PORTNAME}/2.4,} \ ftp://ftp.gtk.org/pub/gtk/v2.3/ \ diff -ruN /usr/ports/devel/glib20/files/patch-gthread_gthread-posix.c glib20/files/patch-gthread_gthread-posix.c --- /usr/ports/devel/glib20/files/patch-gthread_gthread-posix.c Wed Sep 15 12:26:41 2004 +++ glib20/files/patch-gthread_gthread-posix.c Sun Oct 24 03:46:02 2004 @@ -1,5 +1,5 @@ ---- gthread/gthread-posix.c.orig Tue Sep 7 17:57:53 2004 -+++ gthread/gthread-posix.c Tue Sep 7 17:58:30 2004 +--- gthread/gthread-posix.c.orig Mon Nov 4 21:09:47 2002 ++++ gthread/gthread-posix.c Sun Oct 24 03:44:57 2004 @@ -116,6 +116,7 @@ #endif /* POSIX_MIN_PRIORITY && POSIX_MAX_PRIORITY */ @@ -8,7 +8,7 @@ #define G_MUTEX_SIZE (sizeof (pthread_mutex_t)) -@@ -125,7 +126,8 @@ +@@ -125,15 +126,17 @@ g_thread_impl_init() { #ifdef _SC_THREAD_STACK_MIN @@ -18,7 +18,18 @@ #endif /* _SC_THREAD_STACK_MIN */ #ifdef HAVE_PRIORITIES # ifdef G_THREADS_IMPL_POSIX -@@ -176,7 +178,7 @@ + { + struct sched_param sched; + int policy; +- posix_check_cmd (pthread_getschedparam (pthread_self(), &policy, &sched)); +- priority_normal_value = sched.sched_priority; ++ priority_normal_value = pthread_getschedparam (pthread_self(), &policy, &sched) ++ ? (PRIORITY_LOW_VALUE * 6 + PRIORITY_URGENT_VALUE * 4) / 10 /* pthread_getschedparam() failed, use same default as in gthread-impl.c */ ++ : sched.sched_priority; + } + # else /* G_THREADS_IMPL_DCE */ + posix_check_cmd (priority_normal_value = +@@ -176,7 +179,7 @@ result = pthread_mutex_trylock ((pthread_mutex_t *) mutex); #ifdef G_THREADS_IMPL_POSIX @@ -27,7 +38,7 @@ return FALSE; #else /* G_THREADS_IMPL_DCE */ if (result == 0) -@@ -307,8 +309,12 @@ +@@ -307,8 +310,12 @@ if (stack_size) { stack_size = MAX (g_thread_min_stack_size, stack_size); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041024054523.9FDEB22E09>