glib/gthread/gthread_wsd.cpp
changeset 18 47c74d1534e1
equal deleted inserted replaced
0:e4d67989cc36 18:47c74d1534e1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <_ansi.h>
       
    24 #include "gthread_wsd.h"
       
    25 #include <glib.h>
       
    26 
       
    27 
       
    28 #if EMULATOR
       
    29 #include <pls.h> // For emulator WSD API 
       
    30 const TUid KLibgthreadUid3 = {0x10281F3A};     // This is the UID of the library
       
    31 
       
    32 G_BEGIN_DECLS
       
    33 extern const GThreadFunctions temp_g_thread_functions_for_glib_use_default;
       
    34 
       
    35 int InitializeWsd(struct global_struct* g)
       
    36 {
       
    37 	memset(g,0,sizeof(struct global_struct));
       
    38 //	memcpy(&(g->VARIABLE_NAME(g_thread_functions_for_glib_use_default ,gthread_posix)),&g_thread_functions_for_glib_use_default_temp,sizeof(GThreadFunctions));	
       
    39 	return KErrNone;
       
    40 }
       
    41 
       
    42 
       
    43 struct global_struct *Gthread_ImpurePtr()
       
    44 {
       
    45 #if defined(__WINSCW__) || defined(__WINS__)
       
    46 
       
    47 	// Access the PLS of this process
       
    48 	struct global_struct* p  = Pls<struct global_struct>(KLibgthreadUid3, &InitializeWsd);
       
    49     return p;	
       
    50 
       
    51 #else
       
    52 		
       
    53 	return NULL;
       
    54 
       
    55 #endif
       
    56 }
       
    57 
       
    58 G_END_DECLS
       
    59 #endif /* EMULATOR */ 
       
    60