pthread_once_raw is a version of pthread_once for internal use
which lacks cancellation support.

It was needed because winpthreads' TLS slot was initialized
lazily using a pthread_once_t, however cancellation support
uses the TLS slot.

We now initialize the TLS slot at startup. As a consequence
pthread_once_raw isn't needed anymore.
---
 mingw-w64-libraries/winpthreads/src/thread.c | 27 --------------------
 1 file changed, 27 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index 48a6041b..671da2c9 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -657,33 +657,6 @@ _pthread_once_cleanup (void *o)
   leaveOnceObject (co);
 }
 
-static int
-_pthread_once_raw (pthread_once_t *o, void (*func)(void))
-{
-  collect_once_t *co;
-  long state = *o;
-
-  CHECK_PTR(o);
-  CHECK_PTR(func);
-
-  if (state == 1)
-    return 0;
-  co = enterOnceObject(o);
-  pthread_mutex_lock(&co->m);
-  if (*o == 0)
-    {
-      func();
-      *o = 1;
-    }
-  else if (*o != 1)
-    fprintf (stderr," once %p is %ld\n", (void *) o, (long) *o);
-  pthread_mutex_unlock(&co->m);
-  leaveOnceObject(co);
-
-  /* Done */
-  return 0;
-}
-
 /* Unimplemented.  */
 void *
 pthread_timechange_handler_np(void *dummy)
-- 
2.55.0.windows.5



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to