[cairo] Recent pthread mutexes addition in cairo

Albert Chin cairo at mlists.thewrittenword.com
Fri Jul 8 15:53:28 PDT 2005


We have access to a diverse set of systems so I tried to determine
what platforms would require -lpthread because of the recent addition
of the pthread_mutex_* functions for cache locking:
  $ cat mutex.c
#include <stdlib.h>
#include <pthread.h>

int
main (void) {
  pthread_mutex_t lck;

  if (pthread_mutex_init(&lck, 0) != 0)
    exit (1);
  if (pthread_mutex_lock(&lck) != 0)
    exit (1);
  if (pthread_mutex_unlock(&lck) != 0)
    exit (1);
  if (pthread_mutex_destroy(&lck) != 0)
    exit (1);

  exit (0);
}

  (Solaris 2.6/SPARC)
  $ uname -a
SunOS beeba 5.6 Generic_105181-39 sun4u sparc SUNW,Ultra-60
  $ cc mutex.c; ./a.out; echo $?
0

  (Solaris 7/SPARC)
  $ uname -a
SunOS vegeta 5.7 Generic_106541-40 sun4u sparc SUNW,Ultra-60
  $ cc mutex.c; ./a.out; echo $?
0

  (Solaris 8/SPARC)
  $ uname -a
SunOS gax 5.8 Generic_117350-25 sun4u sparc SUNW,Sun-Fire-V250
  $ cc mutex.c; ./a.out; echo $?
0

  (Solaris 9/SPARC)
  $ uname -a
SunOS poog 5.9 Generic_117171-12 sun4u sparc SUNW,Sun-Fire-V250
  $ cc mutex.c; ./a.out; echo $?
0

  (Solaris 10/SPARC)
  $ uname -a
SunOS hikaru 5.10 Generic sun4u sparc SUNW,Sun-Fire-V240
  $ cc mutex.c; ./a.out; echo $?
0

  (HP-UX 11.00)
  $ uname -a
HP-UX impulse B.11.00 U 9000/785 2009622912 unlimited-user license
  $ cc mutex.c; ./a.out; echo $?
0

  (HP-UX 11.11)
  $ uname -a
HP-UX hulk B.11.11 U 9000/785 2010914556 unlimited-user license
  $ cc mutex.c; ./a.out; echo $?
0

  (IRIX 6.5)
  $ uname -a
IRIX64 puar 6.5 01080747 IP30
  $ cc mutex.c; ./a.out; echo $?
1
  $ cc mutex.c -lpthread; ./a.out; echo $?
0

  (Tru64 UNIX 4.0D)
  $ uname -a
OSF1 duh V4.0 878 alpha
  $ cc mutex.c && ./a.out; echo $?
ld:
Unresolved:
__pthread_mutex_init
__pthread_mutex_destroy
__pthread_mutex_lock
__pthread_mutex_unlock
1
  $ cc -pthread mutex.c && ./a.out; echo $?
0

  (Tru64 UNIX 5.1)
  $ uname -a
OSF1 gen.il.thewrittenword.com V5.1 732 alpha
  $ cc mutex.c && ./a.out; echo $?
ld:
Unresolved:
__pthread_mutex_init
__pthread_mutex_destroy
__pthread_mutex_lock
__pthread_mutex_unlock
1
  $ cc -pthread mutex.c && ./a.out; echo $?
0

  (AIX 4.3.3)
  $ uname -a
AIX ginyu 3 4 000784654C00
  $ xlc mutex.c
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
  $ xlc_r mutex.c; ./a.out; echo $?
0

  (AIX 5.1)
  $ uname -a
AIX bulma 1 5 000B243D4C00
  $ xlc mutex.c
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
  $ xlc_r mutex.c; ./a.out; echo $?
0

  (AIX 5.2)
  $ uname -a
AIX luna 2 5 0043880C4C00
  $ xlc mutex.c
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
  $ xlc_r mutex.c; ./a.out; echo $?
0

-- 
albert chin (china at thewrittenword.com)



More information about the cairo mailing list