Changeset 181308 in webkit
- Timestamp:
- Mar 9, 2015 9:21:42 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/tests/CompareAndSwapTest.cpp
r181305 r181308 27 27 28 28 #include <stdio.h> 29 #include <thread>30 29 #include <wtf/Atomics.h> 30 #include <wtf/Threading.h> 31 31 32 32 // Regression test for webkit.org/b/142513 … … 76 76 }; 77 77 78 static void *setBitThreadFunc(void* p)78 static void setBitThreadFunc(void* p) 79 79 { 80 80 Data* data = reinterpret_cast<Data*>(p); … … 93 93 94 94 printf(" finished Thread %d\n", data->id); 95 pthread_exit(nullptr);96 95 } 97 96 … … 100 99 Bitmap bitmap; 101 100 const int numThreads = 5; 102 pthread_tthreadIDs[numThreads];101 ThreadIdentifier threadIDs[numThreads]; 103 102 Data data[numThreads]; 104 103 … … 108 107 data[i].id = i; 109 108 data[i].numThreads = numThreads; 110 pthread_create(&threadIDs[i], 0, &setBitThreadFunc, &data[i]); 109 std::function<void()> threadFunc = std::bind(setBitThreadFunc, &data[i]); 110 threadIDs[i] = createThread("setBitThreadFunc", threadFunc); 111 111 } 112 112 113 113 printf("Waiting for %d threads to join\n", numThreads); 114 114 for (int i = 0; i < numThreads; i++) 115 pthread_join(threadIDs[i], nullptr);115 waitForThreadCompletion(threadIDs[i]); 116 116 117 117 printf("PASS: CompareAndSwap test completed without a hang\n"); -
trunk/Source/JavaScriptCore/ChangeLog
r181305 r181308 1 2015-03-09 Mark Lam <mark.lam@apple.com> 2 3 Build fix for Windows after r181305. 4 https://webkit.org/b/142513> 5 6 Reviewed by Alex Christensen. 7 8 Windows doesn't like pthreads anymore. Changed test to use WTF threading. 9 10 * API/tests/CompareAndSwapTest.cpp: 11 (setBitThreadFunc): 12 (testCompareAndSwap): 13 1 14 2015-03-09 Mark Lam <mark.lam@apple.com> 2 15
Note: See TracChangeset
for help on using the changeset viewer.