This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: pthread_mutex_init() with gcc-3.4.3 on Tru64 UNIX
- From: Ishwar Rattan <ishwar at pali dot cps dot cmich dot edu>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 9 Jul 2005 09:15:18 -0400 (EDT)
- Subject: Re: pthread_mutex_init() with gcc-3.4.3 on Tru64 UNIX
- References: <20050708234415.GH10913@mail1.thewrittenword.com>
On Fri, 8 Jul 2005, Albert Chin wrote:
> $ uname -a
> OSF1 [name] V4.0 878 alpha
> $ uname -a
> OSF1 [name] V5.1 732 alpha
>
> $ cat mutex.c
> #include <stdlib.h>
> #include <pthread.h>
>
> int
> main (void) {
> pthread_mutex_t lck;
>
> if (pthread_mutex_init(&lck, 0) != 0)
> exit (2);
> if (pthread_mutex_lock(&lck) != 0)
> exit (3);
> if (pthread_mutex_unlock(&lck) != 0)
> exit (4);
> if (pthread_mutex_destroy(&lck) != 0)
> exit (5);
>
> exit (0);
> }
>
> $ cc mutex.c
Try cc mutex.c -lpthread
-ishwar