Changeset 94191 in webkit for trunk/Source/JavaScriptCore/wtf
- Timestamp:
- Aug 31, 2011, 8:10:10 AM (14 years ago)
- Location:
- trunk/Source/JavaScriptCore/wtf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/wtf/Atomics.h
r93450 r94191 66 66 #elif OS(DARWIN) 67 67 #include <libkern/OSAtomic.h> 68 #elif OS(ANDROID)69 #include <cutils/atomic.h>70 68 #elif OS(QNX) 71 69 #include <atomic.h> … … 104 102 inline int atomicDecrement(int volatile* addend) { return static_cast<int>(atomic_sub_value(reinterpret_cast<unsigned volatile*>(addend), 1)) - 1; } 105 103 106 #elif OS(ANDROID)107 108 inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); }109 inline int atomicDecrement(int volatile* addend) { return android_atomic_dec(addend); }110 111 104 #elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc 112 105 #define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1 -
trunk/Source/JavaScriptCore/wtf/Platform.h
r94044 r94191 178 178 && !defined(__VFP_FP__) \ 179 179 && !defined(_WIN32_WCE) \ 180 && !defined(ANDROID)181 180 #define WTF_CPU_MIDDLE_ENDIAN 1 182 181 … … 304 303 virtual memory, not to choose a GUI toolkit ==== */ 305 304 306 /* OS(ANDROID) - Android */307 #ifdef ANDROID308 #define WTF_OS_ANDROID 1309 #endif310 311 305 /* OS(AIX) - AIX */ 312 306 #ifdef _AIX … … 396 390 /* OS(UNIX) - Any Unix-like system */ 397 391 #if OS(AIX) \ 398 || OS(ANDROID) \399 392 || OS(DARWIN) \ 400 393 || OS(FREEBSD) \ … … 696 689 #if !OS(WINDOWS) && !OS(SOLARIS) && !OS(QNX) \ 697 690 && !OS(SYMBIAN) && !OS(HAIKU) && !OS(RVCT) \ 698 && ! OS(ANDROID) && !PLATFORM(BREWMP)691 && !PLATFORM(BREWMP) 699 692 #define HAVE_TM_GMTOFF 1 700 693 #define HAVE_TM_ZONE 1 … … 769 762 #define HAVE_SYS_TIME_H 1 770 763 771 #elif OS(ANDROID)772 773 #define HAVE_ERRNO_H 1774 #define HAVE_LANGINFO_H 0775 #define HAVE_MMAP 1776 #define HAVE_SBRK 1777 #define HAVE_STRINGS_H 1778 #define HAVE_SYS_PARAM_H 1779 #define HAVE_SYS_TIME_H 1780 781 764 #else 782 765 -
trunk/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp
r92154 r94191 51 51 #endif 52 52 53 #if OS(ANDROID)54 #include "JNIUtility.h"55 #include "ThreadFunctionInvocation.h"56 #include <wtf/OwnPtr.h>57 #include <wtf/PassOwnPtr.h>58 #endif59 60 53 #if OS(MAC_OS_X) && !defined(BUILDING_ON_LEOPARD) 61 54 #include <objc/objc-auto.h> … … 154 147 } 155 148 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 #else188 149 ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*) 189 150 { … … 196 157 return establishIdentifierForPthreadHandle(threadHandle); 197 158 } 198 #endif199 159 200 160 void initializeCurrentThreadInternal(const char* threadName)
Note:
See TracChangeset
for help on using the changeset viewer.