[llvm-branch-commits] [cfe-branch] r118552 - /cfe/branches/Apple/whitney/tools/c-index-test/c-index-test.c

Daniel Dunbar daniel at zuster.org
Tue Nov 9 09:31:27 PST 2010


Author: ddunbar
Date: Tue Nov  9 11:31:27 2010
New Revision: 118552

URL: http://llvm.org/viewvc/llvm-project?rev=118552&view=rev
Log:
Merge r118224:
--
Author: Daniel Dunbar <daniel at zuster.org>
Date:   Thu Nov 4 01:26:31 2010 +0000

    c-index-test: Switch to using clang_executeOnThread instead of mucking about
    with system specific stuff.

Modified:
    cfe/branches/Apple/whitney/tools/c-index-test/c-index-test.c

Modified: cfe/branches/Apple/whitney/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/tools/c-index-test/c-index-test.c?rev=118552&r1=118551&r2=118552&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/tools/c-index-test/c-index-test.c (original)
+++ cfe/branches/Apple/whitney/tools/c-index-test/c-index-test.c Tue Nov  9 11:31:27 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 llvm-branch-commits mailing list