Ignore:
Timestamp:
Mar 5, 2014 6:48:59 AM (10 years ago)
Author:
riza
Message:

Re #1704:

  • Fix duplicate code on os_winphone.h
  • Change the use of PJ_WIN32_WINPHONE to follow the code convention
  • Fix incorrect link of the Thread library
  • Handle exception raised from select() API. However the break window will still be shown when debugging on Visual Studio. To disable it, from Debug>Exceptions>Win32 Exceptions> unmark the "An invalid handle was specified” exception.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/winphone/third_party/threademulation/src/ThreadEmulation.cpp

    r4618 r4777  
    66// Copyright (c) Microsoft Corporation. All rights reserved. 
    77 
    8 //#include "ThreadEmulation.h" 
    98#include "../include/ThreadEmulation.h" 
    109 
     
    2019using namespace Windows::System::Threading; 
    2120 
    22  
    23 #ifdef __cplusplus 
    24 namespace ThreadEmulation 
    25 { 
    26 #endif 
     21//namespace ThreadEmulation 
     22//{ 
    2723    // Stored data for CREATE_SUSPENDED and ResumeThread. 
    2824    struct PendingThreadInfo 
     
    8480    } 
    8581 
    86     _Use_decl_annotations_ HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES unusedThreadAttributes, SIZE_T unusedStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD unusedThreadId) 
     82 
     83    _Use_decl_annotations_ HANDLE WINAPI CreateThreadRT(LPSECURITY_ATTRIBUTES unusedThreadAttributes, SIZE_T unusedStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD unusedThreadId) 
    8784    { 
    8885        // Validate parameters. 
     
    143140    } 
    144141 
    145     _Use_decl_annotations_ DWORD WINAPI ResumeThread(HANDLE hThread) 
     142 
     143    _Use_decl_annotations_ DWORD WINAPI ResumeThreadRT(HANDLE hThread) 
    146144    { 
    147145        lock_guard<mutex> lock(pendingThreadsLock); 
     
    176174 
    177175 
    178     _Use_decl_annotations_ BOOL WINAPI SetThreadPriority(HANDLE hThread, int nPriority) 
     176    _Use_decl_annotations_ BOOL WINAPI SetThreadPriorityRT(HANDLE hThread, int nPriority) 
    179177    { 
    180178        lock_guard<mutex> lock(pendingThreadsLock); 
     
    197195 
    198196 
    199     _Use_decl_annotations_ VOID WINAPI Sleep(DWORD dwMilliseconds) 
     197    _Use_decl_annotations_ VOID WINAPI SleepRT(DWORD dwMilliseconds) 
    200198    { 
    201199        static HANDLE singletonEvent = nullptr; 
     
    226224 
    227225 
    228     DWORD WINAPI TlsAlloc() 
     226    DWORD WINAPI TlsAllocRT() 
    229227    { 
    230228        lock_guard<mutex> lock(tlsAllocationLock); 
     
    243241 
    244242 
    245     _Use_decl_annotations_ BOOL WINAPI TlsFree(DWORD dwTlsIndex) 
     243    _Use_decl_annotations_ BOOL WINAPI TlsFreeRT(DWORD dwTlsIndex) 
    246244    { 
    247245        lock_guard<mutex> lock(tlsAllocationLock); 
     
    273271 
    274272 
    275     _Use_decl_annotations_ LPVOID WINAPI TlsGetValue(DWORD dwTlsIndex) 
     273    _Use_decl_annotations_ LPVOID WINAPI TlsGetValueRT(DWORD dwTlsIndex) 
    276274    { 
    277275        ThreadLocalData* threadData = currentThreadData; 
     
    290288 
    291289 
    292     _Use_decl_annotations_ BOOL WINAPI TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) 
     290    _Use_decl_annotations_ BOOL WINAPI TlsSetValueRT(DWORD dwTlsIndex, LPVOID lpTlsValue) 
    293291    { 
    294292        ThreadLocalData* threadData = currentThreadData; 
     
    355353        } 
    356354    } 
    357 #ifdef __cplusplus 
    358 } 
    359 #endif 
     355//} 
Note: See TracChangeset for help on using the changeset viewer.