Ignore:
Timestamp:
Aug 31, 2011, 8:10:10 AM (14 years ago)
Author:
[email protected]
Message:

Investigate current uses of OS(ANDROID)
https://bugs.webkit.org/show_bug.cgi?id=66761

Reviewed by Darin Adler.

Remove the last legacy Android code.

No new tests needed as the code wasn't tested in the first place.

Source/JavaScriptCore:

  • wtf/Atomics.h:
  • wtf/Platform.h:
  • wtf/ThreadingPthreads.cpp:

(WTF::createThreadInternal):

Source/WebCore:

  • bridge/jni/JNIUtility.cpp:

(JSC::Bindings::getJNIEnv):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp

    r92154 r94191  
    5151#endif
    5252
    53 #if OS(ANDROID)
    54 #include "JNIUtility.h"
    55 #include "ThreadFunctionInvocation.h"
    56 #include <wtf/OwnPtr.h>
    57 #include <wtf/PassOwnPtr.h>
    58 #endif
    59 
    6053#if OS(MAC_OS_X) && !defined(BUILDING_ON_LEOPARD)
    6154#include <objc/objc-auto.h>
     
    154147}
    155148
    156 #if OS(ANDROID)
    157 static void* runThreadWithRegistration(void* arg)
    158 {
    159     OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(static_cast<ThreadFunctionInvocation*>(arg));
    160     JavaVM* vm = JSC::Bindings::getJavaVM();
    161     JNIEnv* env;
    162     void* ret = 0;
    163     if (vm->AttachCurrentThread(&env, 0) == JNI_OK) {
    164         ret = invocation->function(invocation->data);
    165         vm->DetachCurrentThread();
    166     }
    167     return ret;
    168 }
    169 
    170 ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*)
    171 {
    172     pthread_t threadHandle;
    173 
    174     // On the Android platform, threads must be registered with the VM before they run.
    175     OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data));
    176 
    177     if (pthread_create(&threadHandle, 0, runThreadWithRegistration, invocation.get())) {
    178         LOG_ERROR("Failed to create pthread at entry point %p with data %p", entryPoint, data);
    179         return 0;
    180     }
    181 
    182     // The thread will take ownership of invocation.
    183     invocation.leakPtr();
    184 
    185     return establishIdentifierForPthreadHandle(threadHandle);
    186 }
    187 #else
    188149ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*)
    189150{
     
    196157    return establishIdentifierForPthreadHandle(threadHandle);
    197158}
    198 #endif
    199159
    200160void initializeCurrentThreadInternal(const char* threadName)
Note: See TracChangeset for help on using the changeset viewer.