genericopenlibs/openenvcore/libpthread/src/pthread_cond_destroy.cpp
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name        : pthread_cond_destroy.cpp
       
    15 // Part of     : pthread
       
    16 // Interface   : POSIX, pthread
       
    17 // POSIX implementation of pthread on Symbian
       
    18 // Version     :
       
    19 //
       
    20 
       
    21 
       
    22 
       
    23 #include "condvartypes.h"
       
    24 
       
    25 EXPORT_C int pthread_cond_destroy(pthread_cond_t *cond)
       
    26 {
       
    27     if(!cond)
       
    28     {
       
    29         return EINVAL;
       
    30     }
       
    31 
       
    32     if(cond->iState == _ENeedsNormalInit)
       
    33     {
       
    34         return 0;
       
    35     }
       
    36 
       
    37     if(cond->iState != _EInitialized)
       
    38     {
       
    39         return EINVAL;
       
    40     }
       
    41 
       
    42 
       
    43     if( _QueueDestroy(&cond->iQueue) ==0)
       
    44     {
       
    45         cond->iState = _EDestroyed;
       
    46         return 0;
       
    47     }
       
    48     else
       
    49     {
       
    50         return EAGAIN;
       
    51     }
       
    52 }
       
    53 
       
    54 
       
    55 //End of File
       
    56