Changeset 181308 in webkit


Ignore:
Timestamp:
Mar 9, 2015 9:21:42 PM (9 years ago)
Author:
mark.lam@apple.com
Message:

Build fix for Windows after r181305.
https://webkit.org/b/142513>

Reviewed by Alex Christensen.

Windows doesn't like pthreads anymore. Changed test to use WTF threading.

  • API/tests/CompareAndSwapTest.cpp:

(setBitThreadFunc):
(testCompareAndSwap):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/tests/CompareAndSwapTest.cpp

    r181305 r181308  
    2727
    2828#include <stdio.h>
    29 #include <thread>
    3029#include <wtf/Atomics.h>
     30#include <wtf/Threading.h>
    3131
    3232// Regression test for webkit.org/b/142513
     
    7676};
    7777
    78 static void* setBitThreadFunc(void* p)
     78static void setBitThreadFunc(void* p)
    7979{
    8080    Data* data = reinterpret_cast<Data*>(p);
     
    9393
    9494    printf("   finished Thread %d\n", data->id);
    95     pthread_exit(nullptr);
    9695}
    9796
     
    10099    Bitmap bitmap;
    101100    const int numThreads = 5;
    102     pthread_t threadIDs[numThreads];
     101    ThreadIdentifier threadIDs[numThreads];
    103102    Data data[numThreads];
    104103   
     
    108107        data[i].id = i;
    109108        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);
    111111    }
    112112
    113113    printf("Waiting for %d threads to join\n", numThreads);
    114114    for (int i = 0; i < numThreads; i++)
    115         pthread_join(threadIDs[i], nullptr);
     115        waitForThreadCompletion(threadIDs[i]);
    116116
    117117    printf("PASS: CompareAndSwap test completed without a hang\n");
  • trunk/Source/JavaScriptCore/ChangeLog

    r181305 r181308  
     12015-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
    1142015-03-09  Mark Lam  <mark.lam@apple.com>
    215
Note: See TracChangeset for help on using the changeset viewer.