1    /* 
     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     * */
    13    /*
    14     *  ======== SemThread.xdc ========
    15     */
    16    
    17    import xdc.runtime.Error;
    18    import xdc.runtime.knl.ISemaphore;
    19    import xdc.runtime.knl.ISemThreadSupport;
    20    
    21    /*!
    22     *  ======== SemThread ========
    23     *  SemThread Manager.
    24     *
    25     *  This module manages semaphores through its proxy ISemThreadSupport
    26     *  interface. It has a module wide config parameter 
    27     *  {@link #Proxy} which needs to be bound to an OS specific delegate before
    28     *  this module can be used.
    29     *
    30     *  Here is an example showing how the proxy is bound to an BIOS 6.x specific
    31     *  delegate.
    32     *
    33     *  @p(code)
    34     *  var SemThread = xdc.useModule('xdc.runtime.knl.SemThread');
    35     *  SemThread.Proxy = xdc.useModule('ti.sysbios.xdcruntime.SemThreadSupport');
    36     *  @p
    37     *
    38     *  Typically the package containing the delegates have a Settings module that 
    39     *  will bind all {@link xdc.runtime.knl} proxies. The following
    40     *  example sets up all the xdc.runtime.knl proxies.
    41     *
    42     *  @p(code)
    43     *  xdc.useModule("ti.sysbios.xdcruntime.Settings");
    44     *  @p
    45     */
    46    @InstanceInitError      /* because initialization can fail */
    47    @InstanceFinalize       /* have to SemThread_Proxy_delete(sem) on delete */
    48    
    49    module SemThread inherits ISemaphore
    50    {
    51    
    52        /*! Proxy that needs to be bound to an OS specific delegate. */
    53        proxy Proxy inherits ISemThreadSupport;
    54    
    55    instance:
    56    
    57       /*!
    58        *  ======== create ========
    59        *  Create a SemThread object.
    60        *
    61        *  This function creates a new `SemThread` object which is initialized to
    62        *  count.
    63        *
    64        *  @param(count)    initial semaphore count
    65        */
    66        create(Int count);
    67    
    68    internal:
    69    
    70        struct Instance_State {
    71            Proxy.Handle proxyHandle;
    72        }
    73    
    74    }
    75    /*
    76     *  @(#) xdc.runtime.knl; 1, 0, 0,0; 8-8-2017 17:31:10; /db/ztree/library/trees/xdc/xdc-D20/src/packages/
    77     */
    78