X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..14957cd040308e3eeec43d26bae5d76da13fcd85:/wtf/win/MainThreadWin.cpp diff --git a/wtf/win/MainThreadWin.cpp b/wtf/win/MainThreadWin.cpp index 5f0163c..ee3a273 100644 --- a/wtf/win/MainThreadWin.cpp +++ b/wtf/win/MainThreadWin.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,7 +32,7 @@ #include "Assertions.h" #include "Threading.h" -#if !PLATFORM(WIN_CE) +#if !OS(WINCE) #include #endif @@ -50,23 +51,34 @@ LRESULT CALLBACK ThreadingWindowWndProc(HWND hWnd, UINT message, WPARAM wParam, return 0; } -void initializeMainThread() +void initializeMainThreadPlatform() { if (threadingWindowHandle) return; - mainThreadFunctionQueueMutex(); - + HWND hWndParent = 0; +#if OS(WINCE) + WNDCLASS wcex; + memset(&wcex, 0, sizeof(WNDCLASS)); +#else WNDCLASSEX wcex; memset(&wcex, 0, sizeof(WNDCLASSEX)); wcex.cbSize = sizeof(WNDCLASSEX); +#endif wcex.lpfnWndProc = ThreadingWindowWndProc; wcex.lpszClassName = kThreadingWindowClassName; +#if OS(WINCE) + RegisterClass(&wcex); +#else RegisterClassEx(&wcex); + hWndParent = HWND_MESSAGE; +#endif threadingWindowHandle = CreateWindow(kThreadingWindowClassName, 0, 0, - CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, 0, 0); + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, hWndParent, 0, 0, 0); threadingFiredMessage = RegisterWindowMessage(L"com.apple.WebKit.MainThreadFired"); + + initializeCurrentThreadInternal("Main Thread"); } void scheduleDispatchFunctionsOnMainThread() @@ -75,4 +87,4 @@ void scheduleDispatchFunctionsOnMainThread() PostMessage(threadingWindowHandle, threadingFiredMessage, 0, 0); } -} // namespace WebCore +} // namespace WTF