Changeset 51222 in webkit for trunk/JavaScriptCore
- Timestamp:
- Nov 19, 2009, 4:53:38 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r51211 r51222 1 2009-11-19 Alexey Proskuryakov <[email protected]> 2 3 Reviewed by Darin Adler. 4 5 https://bugs.webkit.org/show_bug.cgi?id=31690 6 Make SocketStreamHandleCFNet work on Windows 7 8 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 9 * wtf/MainThread.cpp: 10 (WTF::FunctionWithContext::FunctionWithContext): 11 (WTF::dispatchFunctionsFromMainThread): 12 (WTF::callOnMainThreadAndWait): 13 * wtf/MainThread.h: 14 Re-add callOnMainThreadAndWait(), which was removed in bug 23926. 15 1 16 2009-11-19 Dmitry Titov <[email protected]> 2 17 -
trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r51168 r51222 53 53 ?call@JSC@@YA?AVJSValue@1@PAVExecState@1@V21@W4CallType@1@ABTCallData@1@1ABVArgList@1@@Z 54 54 ?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z 55 ?callOnMainThreadAndWait@WTF@@YAXP6AXPAX@Z0@Z 55 56 ?changePrototypeTransition@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@PAV12@VJSValue@2@@Z 56 57 ?checkSameIdentifierTable@Identifier@JSC@@CAXPAVExecState@2@PAURep@UString@2@@Z -
trunk/JavaScriptCore/wtf/MainThread.cpp
r46598 r51222 40 40 MainThreadFunction* function; 41 41 void* context; 42 ThreadCondition* syncFlag; 42 43 43 FunctionWithContext(MainThreadFunction* function = 0, void* context = 0 )44 FunctionWithContext(MainThreadFunction* function = 0, void* context = 0, ThreadCondition* syncFlag = 0) 44 45 : function(function) 45 46 , context(context) 47 , syncFlag(syncFlag) 46 48 { 47 49 } … … 93 95 94 96 invocation.function(invocation.context); 97 if (invocation.syncFlag) 98 invocation.syncFlag->signal(); 95 99 96 100 // If we are running accumulated functions for too long so UI may become unresponsive, we need to … … 118 122 } 119 123 124 void callOnMainThreadAndWait(MainThreadFunction* function, void* context) 125 { 126 ASSERT(function); 127 128 if (isMainThread()) { 129 function(context); 130 return; 131 } 132 133 ThreadCondition syncFlag; 134 Mutex& functionQueueMutex = mainThreadFunctionQueueMutex(); 135 MutexLocker locker(functionQueueMutex); 136 functionQueue().append(FunctionWithContext(function, context, &syncFlag)); 137 if (functionQueue().size() == 1) 138 scheduleDispatchFunctionsOnMainThread(); 139 syncFlag.wait(functionQueueMutex); 140 } 141 120 142 void setMainThreadCallbacksPaused(bool paused) 121 143 { -
trunk/JavaScriptCore/wtf/MainThread.h
r40969 r51222 39 39 void callOnMainThread(MainThreadFunction*, void* context); 40 40 41 // Blocks the thread until the call finishes on the main thread. Misusing this can easily cause deadlocks. 42 void callOnMainThreadAndWait(MainThreadFunction*, void* context); 43 41 44 void setMainThreadCallbacksPaused(bool paused); 42 45 … … 53 56 54 57 using WTF::callOnMainThread; 58 using WTF::callOnMainThreadAndWait; 55 59 using WTF::setMainThreadCallbacksPaused; 56 60
Note:
See TracChangeset
for help on using the changeset viewer.