vghwinterface/vghwapiwrapper/src/platformthreading.cpp
author Matt Plumtree <matt.plumtree@nokia.com>
Wed, 06 Oct 2010 17:59:01 +0100
branchbug235_bringup_0
changeset 53 c2ef9095503a
parent 21 hostsupport/hostthreadadapter/src/platformthreading.cpp@f912a08d3c3a
permissions -rw-r--r--
Copy code from the holdingarea into the target locations. Some initial rework of CMakeLists.txt files, but not yet tested.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
     2
// All rights reserved.
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
     3
// This component and the accompanying materials are made available
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
     5
// which accompanies this distribution, and is available
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
     7
//
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
     8
// Initial Contributors:
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
     9
// Nokia Corporation - initial contribution.
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    10
//
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    11
// Contributors:
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    12
//
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    13
// Description:
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    14
// Cross platform threading support library
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    15
21
f912a08d3c3a Contribute a cmake build file for hostthreadadapter, to aid building the intermediate versions of other host components.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 10
diff changeset
    16
#include "hostthreadadapter.h"
10
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    17
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    18
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    19
#include <windows.h>
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    20
#include <WinBase.h>
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    21
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    22
#include <unistd.h>
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    23
#include <time.h>
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    24
#include <signal.h>
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    25
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    26
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    27
#include <stdio.h>
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    28
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    29
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    30
#ifdef __GNUG__
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    31
static void CALLBACK default_interrupt_handler(ULONG_PTR)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    32
#else // MSVC
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    33
static VOID CALLBACK default_interrupt_handler(__in  ULONG_PTR)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    34
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    35
#else // LINUX
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    36
static void default_interrupt_handler(int)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    37
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    38
{
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    39
    // does nothing
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    40
    ;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    41
}
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    42
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    43
namespace Psu
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    44
{
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    45
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    46
#ifndef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    47
    const int MicrosecsInMillisec = 1000;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    48
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    49
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    50
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    51
    int platform_create_simple_thread(PLATFORM_THREAD_T * pThreadHandle,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    52
                                      PLATFORM_THREADFUNC pFunc,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    53
                                      void * param)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    54
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    55
        int
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    56
            rv = 0;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    57
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    58
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    59
        DWORD
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    60
            threadId,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    61
            stackSize = 0,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    62
            creationFlags = 0;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    63
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    64
        PLATFORM_THREAD_T
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    65
            tmp =  CreateThread(NULL,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    66
                                stackSize,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    67
                                pFunc,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    68
                                param,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    69
                                creationFlags,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    70
                                &threadId);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    71
        if (tmp == NULL)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    72
            {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    73
                rv = GetLastError();
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    74
            }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    75
        else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    76
            {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    77
                *pThreadHandle = tmp;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    78
            }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    79
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    80
        rv = pthread_create(pThreadHandle,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    81
                            0,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    82
                            pFunc,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    83
                            param);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    84
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    85
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    86
        return rv;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    87
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    88
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    89
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    90
    void platform_release_thread(PLATFORM_THREAD_T threadHandle)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    91
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    92
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    93
        CloseHandle(threadHandle);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    94
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    95
        pthread_detach(threadHandle);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    96
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    97
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    98
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
    99
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   100
    STATUS_T platform_join_thread(PLATFORM_THREAD_T threadHandle)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   101
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   102
		STATUS_T retVal;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   103
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   104
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   105
        retVal = WaitForSingleObject(threadHandle,INFINITE);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   106
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   107
        retVal = pthread_join(threadHandle, NULL);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   108
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   109
		return retVal;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   110
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   111
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   112
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   113
    void platform_mutex_init(PLATFORM_MUTEX_T * pMutex)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   114
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   115
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   116
        InitializeCriticalSection(pMutex);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   117
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   118
        pthread_mutex_init(pMutex,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   119
                           0);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   120
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   121
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   122
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   123
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   124
    void platform_mutex_destroy(PLATFORM_MUTEX_T * pMutex)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   125
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   126
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   127
        DeleteCriticalSection(pMutex);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   128
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   129
        pthread_mutex_destroy(pMutex);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   130
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   131
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   132
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   133
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   134
    void platform_mutex_lock(PLATFORM_MUTEX_T * pMutex)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   135
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   136
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   137
        EnterCriticalSection(pMutex);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   138
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   139
        pthread_mutex_lock(pMutex);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   140
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   141
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   142
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   143
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   144
    void platform_mutex_unlock(PLATFORM_MUTEX_T * pMutex)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   145
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   146
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   147
        LeaveCriticalSection(pMutex);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   148
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   149
        pthread_mutex_unlock(pMutex);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   150
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   151
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   152
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   153
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   154
    void platform_sleep(int millisecs)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   155
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   156
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   157
        Sleep(millisecs);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   158
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   159
        usleep(millisecs * MicrosecsInMillisec);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   160
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   161
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   162
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   163
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   164
    STATUS_T platform_create_semaphore(PLATFORM_SEMAPHORE_T& semHandle,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   165
    					int initialCount,int maximumCount)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   166
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   167
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   168
 		STATUS_T rv =0;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   169
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   170
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   171
        PLATFORM_SEMAPHORE_T
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   172
            tmp =  CreateSemaphore(NULL,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   173
                                initialCount,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   174
                                maximumCount,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   175
                                NULL);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   176
        if (tmp == NULL)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   177
            {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   178
                rv = GetLastError();
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   179
            }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   180
        else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   181
            {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   182
                semHandle = tmp;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   183
            }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   184
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   185
        rv = sem_init(&semHandle,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   186
                            0,
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   187
                            initialCount);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   188
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   189
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   190
        return rv;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   191
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   192
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   193
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   194
    STATUS_T platform_wait_for_signal(PLATFORM_SEMAPHORE_T& semHandle)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   195
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   196
		STATUS_T retVal;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   197
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   198
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   199
        retVal = WaitForSingleObject(semHandle,	INFINITE);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   200
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   201
        retVal = sem_wait(&semHandle);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   202
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   203
		return retVal;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   204
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   205
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   206
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   207
    void platform_signal_semaphore(PLATFORM_SEMAPHORE_T& semHandle)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   208
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   209
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   210
        ReleaseSemaphore(semHandle, 1, NULL);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   211
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   212
        sem_post(&semHandle);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   213
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   214
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   215
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   216
    void platform_release_semaphore(PLATFORM_SEMAPHORE_T& semHandle)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   217
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   218
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   219
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   220
        CloseHandle(semHandle);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   221
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   222
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   223
        sem_destroy(&semHandle);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   224
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   225
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   226
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   227
    int32_t platform_interruptable_sleep(int64_t length)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   228
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   229
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   230
        return SleepEx(static_cast<DWORD>(length), TRUE);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   231
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   232
        struct timespec req = {0};
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   233
        time_t sec = (int)(length/1000);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   234
        length = length - (sec*1000);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   235
        req.tv_sec = sec;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   236
        req.tv_nsec = length*1000000L;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   237
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   238
        int ret = nanosleep(&req, NULL);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   239
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   240
        return ret;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   241
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   242
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   243
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   244
    bool platform_interrupt_sleep(PLATFORM_THREAD_T handle)
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   245
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   246
#ifdef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   247
        int32_t result = QueueUserAPC(default_interrupt_handler, handle, 0);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   248
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   249
        return (result!=0);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   250
#else
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   251
        return (0 == pthread_kill(handle, SIGUSR1));
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   252
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   253
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   254
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   255
#ifndef WIN32
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   256
    SignalUSR1Handler SignalUSR1Handler::instance;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   257
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   258
    SignalUSR1Handler::SignalUSR1Handler()
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   259
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   260
        //sa = {0}, old = {0};
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   261
        sa.sa_handler = &default_interrupt_handler;
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   262
        sigaction(SIGUSR1, &sa, &old);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   263
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   264
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   265
    SignalUSR1Handler::~SignalUSR1Handler()
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   266
    {
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   267
        sigaction(SIGUSR1, &old, NULL);
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   268
    }
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   269
#endif
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   270
cd3ce1b777ef bug235_bringup_0 - virtualvideohwinterface.cpp dynamic buffer handling update. Register handling update. Support for static videomemory (platsim). hostsupport/hostthreadadapter/ win32text plugin end of line changes.
Jani Hyvonen<jani.hyvonen@nokia.com>
parents: 6
diff changeset
   271
}