aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/System
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-11-04 01:26:25 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-11-04 01:26:25 +0000
commitea8e20696e0bc8313b9459484797614a769a5e0c (patch)
treef644b974fdaaf33f2b4b6bb99ee5f792a7585c77 /include/llvm/System
parent70933266ae73c891d9d1c2f0de72ecd1db8f86df (diff)
downloadexternal_llvm-ea8e20696e0bc8313b9459484797614a769a5e0c.zip
external_llvm-ea8e20696e0bc8313b9459484797614a769a5e0c.tar.gz
external_llvm-ea8e20696e0bc8313b9459484797614a769a5e0c.tar.bz2
System: Add llvm_execute_on_thread, which does what it says.
- Primarily useful for running some code with a specified stack size, when pthreads are available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/System')
-rw-r--r--include/llvm/System/Threading.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/System/Threading.h b/include/llvm/System/Threading.h
index 42d2f89..1d0ed1e 100644
--- a/include/llvm/System/Threading.h
+++ b/include/llvm/System/Threading.h
@@ -40,6 +40,20 @@ namespace llvm {
/// release_global_lock - Release the global lock. This is a no-op if called
/// before llvm_start_multithreaded().
void llvm_release_global_lock();
+
+ /// llvm_execute_on_thread - Execute the given \arg UserFn on a separate
+ /// thread, passing it the provided \arg UserData.
+ ///
+ /// This function does not guarantee that the code will actually be executed
+ /// on a separate thread or honoring the requested stack size, but tries to do
+ /// so where system support is available.
+ ///
+ /// \param UserFn - The callback to execute.
+ /// \param UserData - An argument to pass to the callback function.
+ /// \param RequestedStackSize - If non-zero, a requested size (in bytes) for
+ /// the thread stack.
+ void llvm_execute_on_thread(void (*UserFn)(void*), void *UserData,
+ unsigned RequestedStackSize = 0);
}
#endif