1    /* --COPYRIGHT--,ESD
     2     *  Copyright (c) 2008 Texas Instruments. All rights reserved. 
     3     *  This program and the accompanying materials are made available under the 
     4     *  terms of the Eclipse Public License v1.0 and Eclipse Distribution License
     5     *  v. 1.0 which accompanies this distribution. The Eclipse Public License is
     6     *  available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse
     7     *  Distribution License is available at 
     8     *  http://www.eclipse.org/org/documents/edl-v10.php.
     9     *
    10     *  Contributors:
    11     *      Texas Instruments - initial implementation
    12     * --/COPYRIGHT--*/
    13    /*
    14     *  ======== Sync.xdc ========
    15     */
    16    import xdc.runtime.Error;
    17    import xdc.runtime.Assert;
    18    import xdc.runtime.knl.ISync;
    19    
    20    /*!
    21     *  ======== Sync ========
    22     *  Provides synchronization APIs when an ISync.Handle is available.
    23     *
    24     *  The application must first obtain an ISync.Handle. 
    25     *  It can get such a handle by directly calling {@link SyncGeneric#create} or 
    26     *  {@link SyncSemThread#create}. Then the application can use the generic 
    27     *  APIs provided by this module.
    28     */
    29    
    30    module Sync
    31    {
    32        /*!
    33         *  Proxy used for optimization.
    34         *
    35         *  If ALL ISync.Handles were created using the same module 
    36         *  (e.g SyncSemProcess) then setting this Proxy to SyncSemProcess and 
    37         *  setting Sync.Proxy.abstractInstances$ = false, 
    38         *  Sync APIs can have better performance.
    39         */
    40        proxy Proxy inherits ISync;
    41    
    42        /*!
    43         *  ======== query ========
    44         *  Query for a particular quality.
    45         *
    46         *  FALSE is returned if quality not supported.
    47         *
    48         *  @param(sync)    sync handle
    49         *  @param(qual)    quality
    50         *  @b(returns)     TRUE or FALSE.
    51         */
    52        Bool query(ISync.Handle sync, Int qual);
    53    
    54        /*!
    55         *  ======== signal ========
    56         *  Called at completion of an activity.
    57         *
    58         *  This function is non-blocking. It is also required that the underlying
    59         *  sync be binary in nature.
    60         *
    61         *  @param(sync)    sync handle
    62         */
    63        Void signal(ISync.Handle sync);
    64    
    65        /*!
    66         *  ======== wait ========
    67         *  Called to wait/poll for completion of an activity.
    68         *
    69         *  This function can block. Non-blocking implementations should return
    70         *  false;
    71         *
    72         *  @param(sync)        sync handle
    73         *  @param(timeout)     timeout
    74         *  @b(returns)         1 for success; 0 for timeout; -1 for error
    75         */
    76        Int wait(ISync.Handle sync, UInt timeout, Error.Block *eb);
    77    }
    78    
    79    /*
    80     *! Revision History
    81     *! ================
    82     *! 17-Apr-2009 nitya    Review updates
    83     */
    84    /*
    85     *  @(#) xdc.runtime.knl; 1, 0, 0,24; 9-3-2009 11:42:01; /db/ztree/library/trees/xdc-t57x/src/packages/
    86     */
    87