diff libc/src/threads/linux/CMakeLists.txt @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 79ff65ed7e25
children
line wrap: on
line diff
--- a/libc/src/threads/linux/CMakeLists.txt	Wed Jul 21 10:27:27 2021 +0900
+++ b/libc/src/threads/linux/CMakeLists.txt	Wed Nov 09 17:45:10 2022 +0900
@@ -1,102 +1,69 @@
-add_gen_header(
-  thread_start_args_h
-  DEF_FILE thread_start_args.h.def
-  GEN_HDR thread_start_args.h
-  PARAMS
-    thread_start_args=${LIBC_TARGET_ARCHITECTURE}/thread_start_args.h.in
-  DATA_FILES
-    ${LIBC_TARGET_ARCHITECTURE}/thread_start_args.h.in
-)
-
-add_entrypoint_object(
-  call_once
-  SRCS
-    call_once.cpp
-  HDRS
-    ../call_once.h
-  DEPENDS
-    .threads_utils
-    libc.config.linux.linux_syscall_h
-    libc.include.sys_syscall
-    libc.include.threads
-)
-
 add_header_library(
   threads_utils
   HDRS
-    thread_utils.h
+    CndVar.h
+    Futex.h
   DEPENDS
-    .thread_start_args_h
+    libc.include.sys_syscall
+    libc.include.threads
+    libc.src.__support.CPP.atomic
+    libc.src.__support.OSUtil.osutil
+    libc.src.__support.threads.mutex
+    libc.src.__support.threads.linux.futex_word_type
 )
 
 add_entrypoint_object(
-  thrd_create
+  cnd_init
   SRCS
-    thrd_create.cpp
+    cnd_init.cpp
   HDRS
-    ../thrd_create.h
-  DEPENDS
-    .threads_utils
-    libc.config.linux.linux_syscall_h
-    libc.include.errno
-    libc.include.sys_syscall
-    libc.include.threads
-    libc.src.__support.common
-    libc.src.errno.__errno_location
-    libc.src.sys.mman.mmap
-  COMPILE_OPTIONS
-    -fno-omit-frame-pointer # This allows us to sniff out the thread args from
-                            # the new thread's stack reliably.
-)
-
-add_entrypoint_object(
-  thrd_join
-  SRCS
-    thrd_join.cpp
-  HDRS
-    ../thrd_join.h
-  DEPENDS
-    .threads_utils
-    libc.config.linux.linux_syscall_h
-    libc.include.sys_syscall
-    libc.include.threads
-    libc.src.sys.mman.munmap
-    libc.src.__support.common
-)
-
-add_entrypoint_object(
-  mtx_init
-  SRCS
-    mtx_init.cpp
-  HDRS
-    ../mtx_init.h
+    ../cnd_init.h
   DEPENDS
     .threads_utils
     libc.include.threads
 )
 
 add_entrypoint_object(
-  mtx_lock
+  cnd_destroy
   SRCS
-    mtx_lock.cpp
+    cnd_destroy.cpp
   HDRS
-    ../mtx_lock.h
+    ../cnd_destroy.h
   DEPENDS
     .threads_utils
-    libc.config.linux.linux_syscall_h
-    libc.include.sys_syscall
     libc.include.threads
 )
 
 add_entrypoint_object(
-  mtx_unlock
+  cnd_wait
   SRCS
-    mtx_unlock.cpp
+    cnd_wait.cpp
   HDRS
-    ../mtx_unlock.h
+    ../cnd_wait.h
   DEPENDS
     .threads_utils
-    libc.config.linux.linux_syscall_h
-    libc.include.sys_syscall
+    libc.include.threads
+    libc.src.__support.threads.mutex
+)
+
+add_entrypoint_object(
+  cnd_signal
+  SRCS
+    cnd_signal.cpp
+  HDRS
+    ../cnd_signal.h
+  DEPENDS
+    .threads_utils
     libc.include.threads
 )
+
+add_entrypoint_object(
+  cnd_broadcast
+  SRCS
+    cnd_broadcast.cpp
+  HDRS
+    ../cnd_broadcast.h
+  DEPENDS
+    .threads_utils
+    libc.include.threads
+)