diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-11-04 01:26:31 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-11-04 01:26:31 +0000 |
commit | a32a6e1abe6972b48b4d5ec79d81b6f7241723bf (patch) | |
tree | 12728f826cd6027e7b50f7b479e1d3a06ec19b10 /tools/c-index-test/c-index-test.c | |
parent | 995aaf9c8f0131bef0215a9a0bc794b83a49e0b7 (diff) |
c-index-test: Switch to using clang_executeOnThread instead of mucking about
with system specific stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test/c-index-test.c')
-rw-r--r-- | tools/c-index-test/c-index-test.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index eae6946982..d0e4cb9e3e 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -1578,11 +1578,6 @@ int cindextest_main(int argc, const char **argv) { * testing of a multithreaded environment (for example, having a reduced stack * size). */ -#include "llvm/Config/config.h" -#ifdef HAVE_PTHREAD_H - -#include <pthread.h> - typedef struct thread_info { int argc; const char **argv; @@ -1596,33 +1591,12 @@ void *thread_runner(void *client_data_v) { int main(int argc, const char **argv) { thread_info client_data; - pthread_t thread; - int res; if (getenv("CINDEXTEST_NOTHREADS")) return cindextest_main(argc, argv); client_data.argc = argc; client_data.argv = argv; - res = pthread_create(&thread, 0, thread_runner, &client_data); - if (res != 0) { - perror("thread creation failed"); - return 1; - } - - res = pthread_join(thread, 0); - if (res != 0) { - perror("thread join failed"); - return 1; - } - + clang_executeOnThread(thread_runner, &client_data, 0); return client_data.result; } - -#else - -int main(int argc, const char **argv) { - return cindextest_main(argc, argv); -} - -#endif |