Changeset: 977f31b78559 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=977f31b78559
Modified Files:
        gdk/gdk_system.c
        gdk/gdk_system.h
Branch: hammertime
Log Message:

Don't need (un)declare_thread functions after all.


diffs (78 lines):

diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -415,32 +415,6 @@ MT_create_thread_data(struct winthread**
        return 0;
 }
 
-int MT_declare_external_thread(const char *threadname) {
-       int ret;
-       struct winthread* w;
-       if ((ret = MT_create_thread_data(&w, MT_THR_DETACHED, threadname)) != 
0) return ret;
-
-       if (TlsSetValue(threadslot, w) == 0) {
-               GDKwinerror("Setting thread-local value failed");
-               TlsFree(threadslot);
-               threadslot = TLS_OUT_OF_INDEXES;
-               return -1;
-       }
-
-       return 0;
-}
-
-void MT_undeclare_external_thread(void) {
-       struct winthread* w = TlsGetValue(threadslot);
-       free(w);
-
-       if (TlsSetValue(threadslot, NULL) == 0) {
-               GDKwinerror(ret, "Unsetting thread-local value failed");
-               TlsFree(threadslot);
-               threadslot = TLS_OUT_OF_INDEXES;
-       }
-}
-
 int
 MT_create_thread(MT_Id *t, void (*f) (void *), void *arg, enum MT_thr_detach 
d, const char *threadname)
 {
@@ -804,29 +778,6 @@ MT_create_thread_data(struct posthread**
        return 0;
 }
 
-int MT_declare_external_thread(const char *threadname) {
-       int ret;
-       struct posthread* p;
-       if ((ret = MT_create_thread_data(&p, MT_THR_DETACHED, threadname)) != 
0) return ret;
-
-       if ((ret = pthread_setspecific(threadkey, p)) != 0) {
-               GDKsyserr(ret, "Setting specific value failed");
-               return -1;
-       }
-
-       return 0;
-}
-
-void MT_undeclare_external_thread(void) {
-       struct posthread* p = pthread_getspecific(threadkey);
-       free(p);
-
-       int ret;
-       if ((ret = pthread_setspecific(threadkey, NULL)) != 0) {
-               GDKsyserr(ret, "Unsetting thread-local value failed");
-       }
-}
-
 int
 MT_create_thread(MT_Id *t, void (*f) (void *), void *arg, enum MT_thr_detach 
d, const char *threadname)
 {
diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h
--- a/gdk/gdk_system.h
+++ b/gdk/gdk_system.h
@@ -152,8 +152,6 @@ gdk_export void MT_thread_setdata(void *
 gdk_export void MT_exiting_thread(void);
 gdk_export MT_Id MT_getpid(void);
 gdk_export int MT_join_thread(MT_Id t);
-gdk_export int MT_declare_external_thread(const char *threadname);
-gdk_export void MT_undeclare_external_thread(void);
 
 #if SIZEOF_VOID_P == 4
 /* "limited" stack size on 32-bit systems */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to