[llvm-commits] [parallel] CVS: llvm/runtime/libthread/Makefile threadlib.c threadlib.h
Misha Brukman
brukman at cs.uiuc.edu
Fri Apr 16 12:18:15 PDT 2004
Changes in directory llvm/runtime/libthread:
Makefile added (r1.1.2.1)
threadlib.c added (r1.1.2.1)
threadlib.h added (r1.1.2.1)
---
Log message:
Add parallel thread start/join LLVM runtime library.
---
Diffs of the changes: (+35 -0)
Index: llvm/runtime/libthread/Makefile
diff -c /dev/null llvm/runtime/libthread/Makefile:1.1.2.1
*** /dev/null Fri Apr 16 12:17:36 2004
--- llvm/runtime/libthread/Makefile Fri Apr 16 12:17:26 2004
***************
*** 0 ****
--- 1,14 ----
+ ##===- runtime/libthread/Makefile --------------------------*- Makefile -*-===##
+ #
+ # The LLVM Compiler Infrastructure
+ #
+ # This file was developed by the LLVM research group and is distributed under
+ # the University of Illinois Open Source License. See LICENSE.TXT for details.
+ #
+ ##===----------------------------------------------------------------------===##
+ LEVEL = ../..
+ BYTECODE_LIBRARY=1
+ LIBRARYNAME=thread
+
+ include $(LEVEL)/Makefile.common
+
Index: llvm/runtime/libthread/threadlib.c
diff -c /dev/null llvm/runtime/libthread/threadlib.c:1.1.2.1
*** /dev/null Fri Apr 16 12:17:36 2004
--- llvm/runtime/libthread/threadlib.c Fri Apr 16 12:17:26 2004
***************
*** 0 ****
--- 1,13 ----
+ #include "threadlib.h"
+ #include <pthread.h>
+
+ int __llvm_thread_start(void*(*fn)(void*), void* arg) {
+ pthread_t pt;
+ return pthread_create(&pt, 0, fn, arg);
+ }
+
+ void __llvm_thread_join(int thread_id) {
+ pthread_join(thread_id, 0);
+ }
+
+
Index: llvm/runtime/libthread/threadlib.h
diff -c /dev/null llvm/runtime/libthread/threadlib.h:1.1.2.1
*** /dev/null Fri Apr 16 12:17:36 2004
--- llvm/runtime/libthread/threadlib.h Fri Apr 16 12:17:26 2004
***************
*** 0 ****
--- 1,8 ----
+ #ifndef THREADLIB_H
+ #define THREADLIB_H
+
+ int __llvm_thread_start(void*(*fn)(void*), void* arg);
+
+ void __llvm_thread_join(int thread_id);
+
+ #endif
More information about the llvm-commits
mailing list