Update contrib.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Name : mutexgeneric.cpp
15 // Part of : PThread library
16 // APIs needed for implementing pthread mutex APIs
23 #include "threadglobals.h"
24 #include "threadcreate.h"
26 int _pthread_atomicMutexLock(void *tlsPtr)
28 _pthread_node_t *selfNodePtr;
29 _global_data_t *glbPtr;
31 THR_PRINTF("[pthread] Begin _pthread_atomicMutexLock\n");
34 THR_PRINTF("[pthread] FATAL: TLS is NULL\n");
38 selfNodePtr = (_pthread_node_t *)tlsPtr;
40 // Global data strcuture Pointer
41 glbPtr = selfNodePtr->glbDataPtr;
43 glbPtr->globalLockForMutex.Wait();
44 THR_PRINTF("[pthread] End _pthread_atomicMutexLock\n");
48 int _pthread_atomicMutexUnlock(void *tlsPtr)
50 _pthread_node_t *selfNodePtr;
51 _global_data_t *glbPtr;
53 THR_PRINTF("[pthread] Begin _pthread_atomicMutexUnlock\n");
56 THR_PRINTF("[pthread] FATAL: TLS is NULL\n");
60 selfNodePtr = (_pthread_node_t *)tlsPtr;
62 // Global data strcuture Pointer
63 glbPtr = selfNodePtr->glbDataPtr;
65 glbPtr->globalLockForMutex.Signal();
67 THR_PRINTF("[pthread] End _pthread_atomicMutexUnlock\n");