diff options
author | Ion-Mihai Tetcu <itetcu@FreeBSD.org> | 2008-05-09 17:11:13 +0000 |
---|---|---|
committer | Ion-Mihai Tetcu <itetcu@FreeBSD.org> | 2008-05-09 17:11:13 +0000 |
commit | 430838889b08d39c15f52756f11acd02cfbb26dc (patch) | |
tree | 77c2d8d92862a9b898f25f1e085b545964883940 /lang/see-devel/files/patch-libsee_dtoa.c | |
parent | Backport of https support from Apt 0.7. This is a useful feature that would be (diff) |
- add new option MULTIPLE_THREADS. With this option enabled libsee/dtoa.c is
compiled with proper thread locking.
- bump PORTVERSION
PR: ports/122525
Submitted by: maintainer
Diffstat (limited to 'lang/see-devel/files/patch-libsee_dtoa.c')
-rw-r--r-- | lang/see-devel/files/patch-libsee_dtoa.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lang/see-devel/files/patch-libsee_dtoa.c b/lang/see-devel/files/patch-libsee_dtoa.c new file mode 100644 index 000000000000..d41a5da30863 --- /dev/null +++ b/lang/see-devel/files/patch-libsee_dtoa.c @@ -0,0 +1,24 @@ +--- libsee/dtoa.c.orig 2005-12-24 04:35:38.000000000 +0100 ++++ libsee/dtoa.c 2008-04-07 11:30:11.529829910 +0200 +@@ -168,6 +168,11 @@ + * the result overflows to +-Infinity or underflows to 0. + */ + ++#ifdef MULTIPLE_THREADS ++#include <pthread.h> ++static pthread_mutex_t mylock[2] = { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER }; ++#endif ++ + #ifndef Long + #define Long long + #endif +@@ -470,6 +475,9 @@ + #ifndef MULTIPLE_THREADS + #define ACQUIRE_DTOA_LOCK(n) /*nothing*/ + #define FREE_DTOA_LOCK(n) /*nothing*/ ++#else ++#define ACQUIRE_DTOA_LOCK(n) pthread_mutex_lock(&mylock[n]); ++#define FREE_DTOA_LOCK(n) pthread_mutex_unlock(&mylock[n]); + #endif + + #define Kmax 15 |