summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn van Groningen2012-03-02 10:36:30 +0000
committerJohn van Groningen2012-03-02 10:36:30 +0000
commitec6d0243f406e73060b2f4e91160cb02032afb98 (patch)
tree4c629c963207bc47ddc0ba6451960bd0a87d1aed
parentmake ccall and centry thread safe on Mac OS X (diff)
use pthread_getspecific instead of _pthread_getspecific on thread safe 64 bit Linux
-rw-r--r--cginstructions.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cginstructions.c b/cginstructions.c
index af6ae73..b72fbb6 100644
--- a/cginstructions.c
+++ b/cginstructions.c
@@ -3664,8 +3664,10 @@ LABEL *pthread_getspecific_label=NULL;
# define SAVED_A_STACK_P_OFFSET 40
# ifdef MACH_O64
# define STRING_tlsp_tls_index "_tlsp_tls_index"
+# define STRING_pthread_getspecific "_pthread_getspecific"
# else
# define STRING_tlsp_tls_index "tlsp_tls_index"
+# define STRING_pthread_getspecific "pthread_getspecific"
# endif
# endif
#endif
@@ -4987,7 +4989,7 @@ void code_ccall (char *c_function_name,char *s,int length)
if (tlsp_tls_index_label==NULL)
tlsp_tls_index_label=enter_label (STRING_tlsp_tls_index,IMPORT_LABEL);
if (pthread_getspecific_label==NULL)
- pthread_getspecific_label=enter_label ("_pthread_getspecific",IMPORT_LABEL);
+ pthread_getspecific_label=enter_label (STRING_pthread_getspecific,IMPORT_LABEL);
i_sub_i_r (16,B_STACK_POINTER);
@@ -5745,7 +5747,7 @@ static void call_pthread_getspecific (int n_integer_parameters,int n_float_param
if (tlsp_tls_index_label==NULL)
tlsp_tls_index_label=enter_label (STRING_tlsp_tls_index,IMPORT_LABEL);
if (pthread_getspecific_label==NULL)
- pthread_getspecific_label=enter_label ("_pthread_getspecific",IMPORT_LABEL);
+ pthread_getspecific_label=enter_label (STRING_pthread_getspecific,IMPORT_LABEL);
if (n_float_parameters>8)
n_float_parameters=8;