1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/libc/src/isthreaded.c Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,57 @@
1.4 +/*
1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* Name : isthreaded.c
1.19 +* Part of : libc library
1.20 +* get/set __isthreaded
1.21 +* This material, including documentation and any related
1.22 +* computer programs, is protected by copyright controlled by
1.23 +* Nokia. All rights are reserved. Copying, including
1.24 +* reproducing, storing, adapting or translating, any
1.25 +* or all of this material requires the prior written consent of
1.26 +* Nokia. This material also contains confidential
1.27 +* information which may not be disclosed to others without the
1.28 +* prior written consent of Nokia.
1.29 +*
1.30 +*/
1.31 +
1.32 +
1.33 +
1.34 +#include <_ansi.h>
1.35 +
1.36 +#if (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__)))
1.37 +#include "libc_wsd_defs.h"
1.38 +#endif
1.39 +
1.40 +//Definition of _isthreaded which will be used by other module as extern
1.41 +#ifndef EMULATOR
1.42 +int _isthreaded = 0;
1.43 +#endif //EMULATOR
1.44 +
1.45 +/**
1.46 + isthreaded : To set and get the variable __isthreaded
1.47 + in exit.c (libc)
1.48 + This function is used by the library libpthread to set the variable
1.49 + __isthreaded to true when pthread_create() is called
1.50 + Returns: __isthreaded.
1.51 +*/
1.52 +
1.53 +EXPORT_C int* isthreaded(void)
1.54 + {
1.55 +#ifdef EMULATOR
1.56 + return &(GetGlobals()->_g___isthreaded);
1.57 +#else
1.58 + return &_isthreaded;
1.59 +#endif /* EMULATOR */
1.60 + }