[Iftop-users] POSIX threads configure test spins on Solaris
Jonathan Abbey
jonabbey at arlut.utexas.edu
Mon, 17 Nov 2003 14:33:55 -0600
On Mon, Nov 17, 2003 at 07:43:37PM +0000, Chris Lightfoot wrote:
| Can you try this patch:
|
| diff -u -r1.2 pthread.c
| --- pthread.c 27 Aug 2003 18:29:27 -0000 1.2
| +++ pthread.c 17 Nov 2003 19:40:27 -0000
| @@ -12,6 +12,7 @@
| #include <stdio.h>
| #include <string.h>
| #include <time.h>
| +#include <unistd.h>
|
| static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
| static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
| @@ -23,8 +24,10 @@
| pthread_mutex_lock(&mtx);
| pthread_cond_signal(&cond);
| pthread_mutex_unlock(&mtx);
| - while (1)
| + while (1) {
| + sleep(1);
| pthread_testcancel();
| + }
| }
|
| /* Start a thread, and have it set a variable to some other value, then signal
|
|
| -- which seems to improve things on a Solaris machine
| here.
Yes, the configure runs to completion successfully now.
Boy, do I hate racey stuff like this.
jon
| --
| ``Any design problem can be solved by adding a level of indirection,
| apart from having too many levels of indirection.'' (Cargill)
--
-------------------------------------------------------------------------------
Jonathan Abbey jonabbey@arlut.utexas.edu
Applied Research Laboratories The University of Texas at Austin
GPG Key: 71767586 at keyserver pgp.mit.edu, http://www.ganymeta.org/workkey.gpg