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     *  ======== Main.xdc ========
    15     */
    16    
    17    package xdc.runtime;
    18    
    19    /*!
    20     *  ======== Main ========
    21     *  Configuration "stand-in" for application code.
    22     *
    23     *  This module is used to enable "module" configuration of application code
    24     *  that is not part of a module.  Configuration of this `Main` module is
    25     *  used for all code not in a module.
    26     *
    27     *  For example, an `ILogger` "service provider" for all code that is not in
    28     *  a RTSC module can be configured by setting this module's `logger`;  when
    29     *  code that is not in a module calls `Log_print()`, for example, this
    30     *  module's `ILogger` handles the event.
    31     *
    32     *  Since this module is "gated", the user can also assign a gate to this 
    33     *  module for use by any code that is not in a module.  This gate can be used
    34     *  to serialize access to global data by multiple threads in the system.
    35     *  @p(code)
    36     *      #include <xdc/runtime/Main.h>
    37     *      #include <xdc/runtime/Gate.h>
    38     *          :
    39     *      int global = 0;
    40     *      int main() {
    41     *          :       // create a bunch of threads
    42     *      }
    43     *
    44     *      void thread() {
    45     *          IArg key = Gate_enterModule();  // enter critical section
    46     *          global++;                       // safely update global data
    47     *          Gate_leaveModule(key);          // leave critical section
    48     *      }
    49     *  @p
    50     */
    51    @Gated module Main {
    52    
    53    };
    54    
    55    /*
    56     *  @(#) xdc.runtime; 2, 1, 0,371; 2-10-2012 10:18:55; /db/ztree/library/trees/xdc/xdc-y21x/src/packages/
    57     */
    58