]> git.proxmox.com Git - wasi-libc.git/commitdiff
Enable a few more pthread* files (pthread_key*, pthread_once) (#348)
authorMarcin Kolny <mkolny@amazon.com>
Wed, 30 Nov 2022 22:16:56 +0000 (22:16 +0000)
committerGitHub <noreply@github.com>
Wed, 30 Nov 2022 22:16:56 +0000 (14:16 -0800)
* threads: enable TSD functions

* threads: Enable pthread_once

Makefile
expected/wasm32-wasi/posix/defined-symbols.txt
libc-top-half/musl/src/thread/pthread_key_create.c

index 59598d467dad4be4c5181aaf630c5c16bff44f39..d6a20f53a63ed71bf0b4f7f772dae58f4114d51f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -214,7 +214,9 @@ LIBC_TOP_HALF_MUSL_SOURCES += \
         thread/pthread_condattr_setclock.c \
         thread/pthread_condattr_setpshared.c \
         thread/pthread_create.c \
+        thread/pthread_getspecific.c \
         thread/pthread_join.c \
+        thread/pthread_key_create.c \
         thread/pthread_mutex_consistent.c \
         thread/pthread_mutex_destroy.c \
         thread/pthread_mutex_init.c \
@@ -229,6 +231,7 @@ LIBC_TOP_HALF_MUSL_SOURCES += \
         thread/pthread_mutexattr_setpshared.c \
         thread/pthread_mutexattr_setrobust.c \
         thread/pthread_mutexattr_settype.c \
+        thread/pthread_once.c \
         thread/pthread_rwlock_destroy.c \
         thread/pthread_rwlock_init.c \
         thread/pthread_rwlock_rdlock.c \
@@ -242,6 +245,7 @@ LIBC_TOP_HALF_MUSL_SOURCES += \
         thread/pthread_rwlockattr_init.c \
         thread/pthread_rwlockattr_setpshared.c \
         thread/pthread_setcancelstate.c \
+        thread/pthread_setspecific.c \
         thread/pthread_self.c \
         thread/pthread_testcancel.c \
         thread/sem_destroy.c \
index 645e44c64190c39f9259ed81394681f4ea1c8309..34aa694333a259e5791330646b8813992897888b 100644 (file)
@@ -194,11 +194,15 @@ __pthread_cond_timedwait
 __pthread_create
 __pthread_exit
 __pthread_join
+__pthread_key_create
+__pthread_key_delete
 __pthread_mutex_lock
 __pthread_mutex_timedlock
 __pthread_mutex_trylock
 __pthread_mutex_trylock_owner
 __pthread_mutex_unlock
+__pthread_once
+__pthread_once_full
 __pthread_rwlock_rdlock
 __pthread_rwlock_timedrdlock
 __pthread_rwlock_timedwrlock
@@ -979,7 +983,10 @@ pthread_condattr_setclock
 pthread_condattr_setpshared
 pthread_create
 pthread_exit
+pthread_getspecific
 pthread_join
+pthread_key_create
+pthread_key_delete
 pthread_mutex_consistent
 pthread_mutex_destroy
 pthread_mutex_getprioceiling
@@ -994,6 +1001,7 @@ pthread_mutexattr_setprotocol
 pthread_mutexattr_setpshared
 pthread_mutexattr_setrobust
 pthread_mutexattr_settype
+pthread_once
 pthread_rwlock_destroy
 pthread_rwlock_init
 pthread_rwlock_rdlock
@@ -1008,6 +1016,7 @@ pthread_rwlockattr_init
 pthread_rwlockattr_setpshared
 pthread_self
 pthread_setcancelstate
+pthread_setspecific
 pthread_testcancel
 pthread_timedjoin_np
 pthread_tryjoin_np
@@ -1219,6 +1228,7 @@ truncate
 truncf
 truncl
 tsearch
+tss_get
 twalk
 uname
 ungetc
index d112094122b316d161a6fd17f1c08d12d0b58e05..dd47caa51d0a065318c30c7ea2abfaa0664f605d 100644 (file)
@@ -50,7 +50,9 @@ int __pthread_key_delete(pthread_key_t k)
        sigset_t set;
        pthread_t self = __pthread_self(), td=self;
 
+#ifdef __wasilibc_unmodified_upstream
        __block_app_sigs(&set);
+#endif
        __pthread_rwlock_wrlock(&key_lock);
 
        __tl_lock();
@@ -61,7 +63,9 @@ int __pthread_key_delete(pthread_key_t k)
        keys[k] = 0;
 
        __pthread_rwlock_unlock(&key_lock);
+#ifdef __wasilibc_unmodified_upstream
        __restore_sigs(&set);
+#endif
 
        return 0;
 }