Ignore:
Timestamp:
Jul 15, 2009, 11:23:28 AM (16 years ago)
Author:
[email protected]
Message:

2009-07-15 George Staikos <[email protected]>

Reviewed by Adam Treat.

https://bugs.webkit.org/show_bug.cgi?id=27303
Implement createThreadInternal for WinCE.
Contains changes by George Staikos <[email protected]> and Joe Mason <[email protected]>

  • wtf/ThreadingWin.cpp: (WTF::createThreadInternal):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/ThreadingWin.cpp

    r43663 r45931  
    22 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 * Copyright (C) 2009 Google Inc. All rights reserved.
     4 * Copyright (C) 2009 Torch Mobile, Inc. All rights reserved.
    45 *
    56 * Redistribution and use in source and binary forms, with or without
     
    9091#include "ThreadSpecific.h"
    9192#endif
     93#if !PLATFORM(WINCE)
    9294#include <process.h>
     95#endif
     96#if HAVE(ERRNO_H)
     97#include <errno.h>
     98#else
     99#define NO_ERRNO
     100#endif
    93101#include <windows.h>
    94102#include <wtf/CurrentTime.h>
     
    211219    ThreadIdentifier threadID = 0;
    212220    ThreadFunctionInvocation* invocation = new ThreadFunctionInvocation(entryPoint, data);
     221#if PLATFORM(WINCE)
     222    // This is safe on WINCE, since CRT is in the core and innately multithreaded.
     223    // On desktop Windows, need to use _beginthreadex (not available on WinCE) if using any CRT functions
     224    HANDLE threadHandle = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)wtfThreadEntryPoint, invocation, 0, (LPDWORD)&threadIdentifier);
     225#else
    213226    HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex(0, 0, wtfThreadEntryPoint, invocation, 0, &threadIdentifier));
     227#endif
    214228    if (!threadHandle) {
     229#if PLATFORM(WINCE)
     230        LOG_ERROR("Failed to create thread at entry point %p with data %p: %ld", entryPoint, data, ::GetLastError());
     231#elif defined(NO_ERRNO)
     232        LOG_ERROR("Failed to create thread at entry point %p with data %p.", entryPoint, data);
     233#else
    215234        LOG_ERROR("Failed to create thread at entry point %p with data %p: %ld", entryPoint, data, errno);
     235#endif
    216236        return 0;
    217237    }
Note: See TracChangeset for help on using the changeset viewer.