From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.bugs,gmane.comp.programming.garbage-collection.boehmgc Subject: Re: [Gc] Calling =?utf-8?B?4oCYR0NfSU5JVOKAmQ==?= from a secondary thread Date: Sun, 17 Apr 2011 21:49:10 +0200 Message-ID: <87r590d5ft.fsf@gnu.org> References: <87writc6zl.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1303069768 8900 80.91.229.12 (17 Apr 2011 19:49:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 17 Apr 2011 19:49:28 +0000 (UTC) Cc: bug-guile@gnu.org, gc@linux.hpl.hp.com To: Ivan Maidanski Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Apr 17 21:49:23 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QBXyF-00046R-4j for guile-bugs@m.gmane.org; Sun, 17 Apr 2011 21:49:23 +0200 Original-Received: from localhost ([::1]:58317 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBXyE-0007nx-En for guile-bugs@m.gmane.org; Sun, 17 Apr 2011 15:49:22 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBXyA-0007nr-Nd for bug-guile@gnu.org; Sun, 17 Apr 2011 15:49:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QBXy9-0006XZ-DW for bug-guile@gnu.org; Sun, 17 Apr 2011 15:49:18 -0400 Original-Received: from solo.fdn.fr ([80.67.169.19]:35668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBXy8-0006XS-Oe for bug-guile@gnu.org; Sun, 17 Apr 2011 15:49:17 -0400 Original-Received: from nixey (reverse-83.fdn.fr [80.67.176.83]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) (Authenticated sender: lcourtes) by smtp.fdn.fr (Postfix) with ESMTPSA id 29693254483; Sun, 17 Apr 2011 21:49:15 +0200 (CEST) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 Germinal an 219 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: (Ivan Maidanski's message of "Sun, 17 Apr 2011 18:11:13 +0400") User-Agent: Gnus/5.110015 (No Gnus v0.15) Emacs/23.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 80.67.169.19 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5502 gmane.comp.programming.garbage-collection.boehmgc:4496 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ivan, Ivan Maidanski writes: > NP, I think. Just prepare a patch. Here=E2=80=99s one, without the re-generated files. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename=",,init-secondary-test.patch" Content-Transfer-Encoding: quoted-printable Content-Description: the patch Index: ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/bdwgc/bdwgc/ChangeLog,v retrieving revision 1.467 diff -u -B -b -r1.467 ChangeLog --- ChangeLog 16 Apr 2011 09:32:15 -0000 1.467 +++ ChangeLog 17 Apr 2011 19:46:58 -0000 @@ -1,3 +1,10 @@ +2011-04-17 Ludovic Court=E8s + + * tests/tests.am (TESTS, check_PROGRAMS)[THREADS]: Add + `initsecondarythread'. + (initsecondarythread_SOURCES) + (initsecondarythread_LDADD)[THREADS]: New variables. + 2011-04-16 Ivan Maidanski =20 * os_dep.c (GC_get_main_stack_base): Try to use Index: tests/tests.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/bdwgc/bdwgc/tests/tests.am,v retrieving revision 1.9 diff -u -B -b -r1.9 tests.am --- tests/tests.am 23 Mar 2010 07:53:03 -0000 1.9 +++ tests/tests.am 17 Apr 2011 19:47:25 -0000 @@ -67,6 +67,11 @@ check_PROGRAMS +=3D threadleaktest threadleaktest_SOURCES =3D tests/thread_leak_test.c threadleaktest_LDADD =3D $(test_ldadd) + +TESTS +=3D initsecondarythread$(EXEEXT) +check_PROGRAMS +=3D initsecondarythread +initsecondarythread_SOURCES =3D tests/initsecondarythread.c +initsecondarythread_LDADD =3D $(test_ldadd) endif =20 if CPLUSPLUS --- /dev/null 2011-04-15 17:57:42.483006363 +0200 +++ tests/initsecondarythread.c 2011-04-17 21:48:31.000000000 +0200 @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 Ludovic Court=E8s + * + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * + * Permission is hereby granted to use or copy this program + * for any purpose, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is grante= d, + * provided the above notices are retained, and a notice that the code was + * modified is included with the above copyright notice. + */ + +/* Make sure `GC_INIT' can be called from threads other than the initial + * thread. See + * + * for the original report. */ + +#if defined(__sun__) || defined(sun) + +/* Solaris expects `GC_INIT' to be called from the main thread, so skip th= is + * test. */ + +int main(int argc, char *argv[]) +{ + /* Skip. */ + return 77; +} + +#else /* ! __sun__ */ + +#define GC_THREADS 1 +#define GC_NO_THREAD_REDIRECTS 1 + +#include +#include +#include + +static void *thread(void *arg) +{ + GC_INIT (); + GC_MALLOC (123); + GC_MALLOC (12345); + return NULL; +} + +int main(int argc, char *argv[]) +{ + pthread_t t; + + pthread_create (&t, NULL, thread, NULL); + pthread_join (t, NULL); + + return EXIT_SUCCESS; +} + +#endif /* ! __sun__ */ --=-=-=--