os/ossrv/genericopenlibs/openenvcore/libc/src/isthreaded.c
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2005-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 * Name        : isthreaded.c
    16 * Part of     : libc library
    17 * get/set __isthreaded
    18 * This material, including documentation and any related 
    19 * computer programs, is protected by copyright controlled by 
    20 * Nokia. All rights are reserved. Copying, including 
    21 * reproducing, storing, adapting or translating, any 
    22 * or all of this material requires the prior written consent of 
    23 * Nokia. This material also contains confidential 
    24 * information which may not be disclosed to others without the 
    25 * prior written consent of Nokia.
    26 *
    27 */
    28 
    29 
    30 
    31 #include <_ansi.h>
    32 
    33 #if (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__)))
    34 #include "libc_wsd_defs.h"
    35 #endif
    36 
    37 //Definition of _isthreaded which will be used by other module as extern
    38 #ifndef EMULATOR
    39 int _isthreaded = 0;
    40 #endif //EMULATOR
    41 
    42 /**
    43  isthreaded :  To set and get the variable __isthreaded
    44  in exit.c (libc)
    45  This function is used by the library libpthread to set the variable 
    46  __isthreaded to true when pthread_create() is called 
    47  Returns: __isthreaded.
    48 */
    49 
    50 EXPORT_C int* isthreaded(void)
    51 	{
    52 #ifdef EMULATOR
    53 	return &(GetGlobals()->_g___isthreaded);
    54 #else
    55 	return &_isthreaded;
    56 #endif /* EMULATOR */
    57 	}