[cfe-commits] r118224 - /cfe/trunk/tools/c-index-test/c-index-test.c

Daniel Dunbar daniel at zuster.org
Wed Nov 3 18:26:31 PDT 2010


Author: ddunbar
Date: Wed Nov  3 20:26:31 2010
New Revision: 118224

URL: http://llvm.org/viewvc/llvm-project?rev=118224&view=rev
Log:
c-index-test: Switch to using clang_executeOnThread instead of mucking about
with system specific stuff.

Modified:
    cfe/trunk/tools/c-index-test/c-index-test.c

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=118224&r1=118223&r2=118224&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Wed Nov  3 20:26:31 2010
@@ -1578,11 +1578,6 @@
  * 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 @@
 
 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





More information about the cfe-commits mailing list