ports/73060: Update port: devel/glib20 (fix POSIX threads)

Jean-Yves Lefort jylefort at brutele.be
Sun Oct 24 05:50:27 UTC 2004


>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 at 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:



More information about the freebsd-ports-bugs mailing list