Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Name : threadcreate.h
16 * Part of : PThread library
17 * Data structure needed for thread creatation.
24 #ifndef THREADCREATE_H
25 #define THREADCREATE_H
31 #define MIN_RR_PRIORITY 0
32 #define MAX_RR_PRIORITY 255
34 // On any addition or deletion to this pthread_attr structure, update
35 // _TOTALSIZEOF_PTHREAD_ATTR_T
38 /* Scheduler parameters; Only priority. */
40 unsigned int stackSize;
41 unsigned int detachState;
43 struct sched_param sp;
45 unsigned int reserved1;
46 unsigned int reserved2;
49 typedef void *(*_START_ROUTINE) (void *);
50 typedef int (*_START_ROUTINE_SOS) (void *);
53 // MinGW GCC compiler does not like typedef struct definitions with no tag
54 typedef struct _wrapperFunArgs_tag
59 _START_ROUTINE begin_routine;
62 /*******************************************************************
63 Overloading new and delete operators so that they will
64 allocate and deallocare memory from/to the private heap of backend
65 ********************************************************************/
66 inline TAny* operator new(TUint aSize, TAny* aBase) __NO_THROW
68 Mem::FillZ(aBase, aSize); return aBase;
71 inline TAny* operator new(TUint aSize) __NO_THROW
73 return Backend()->Alloc(aSize);
76 inline TAny* operator new(TUint aSize, TLeave)
78 TAny* ptr = Backend()->Alloc(aSize);
81 User::Leave(KErrNoMemory);
86 inline TAny* operator new(TUint aSize, TUint aExtraSize) __NO_THROW
88 return Backend()->Alloc(aSize + aExtraSize);
91 inline TAny* operator new(TUint aSize, TLeave, TUint aExtraSize)
93 TAny* ptr = Backend()->Alloc(aSize + aExtraSize);
96 User::Leave(KErrNoMemory);
101 inline void operator delete(TAny *aPtr) __NO_THROW
103 Backend()->Free( aPtr );
109 #endif //THREADCREATE_H