Jeff Trawick <[EMAIL PROTECTED]> writes:
> Solaris will link in APR_SUCCESS-style no-op pthread functions if your
> application isn't built thread-capable.
Glibc on Linux does the same for things like pthread_mutex_lock:
$ cat z.c
#include <pthread.h>
int main()
{
if (pthread_mutex_lock(NULL))
return 1;
return 0;
}
$ gcc z.c # build without threads
$ ./a.out
$ echo $?
0
$ gcc -pthread z.c # with threads
$ ./a.out
Segmentation fault
> If APR always provides such APIs and acts like they work, what is to
> signal to a threaded APR app that they are picking up a non-threaded
> libapr?
Glibc doesn't provide no-op functions for things like
pthread_mutex_create, those are only available when the full threading
library replaces all the no-op functions.
--
Philip Martin