1 2 3 4 5 6 7 8 9 10 11 12
13 14 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
47 @InstanceInitError
48 @InstanceFinalize
49
50 module SemThread inherits ISemaphore
51 {
52
53 /*! Proxy that needs to be bound to an OS specific delegate. */
54 proxy Proxy inherits ISemThreadSupport;
55
56 instance:
57
58 /*!
59 * ======== create ========
60 * Create a SemThread object.
61 *
62 * This function creates a new `SemThread` object which is initialized to
63 * count.
64 *
65 * @param(count) initial semaphore count
66 */
67 create(Int count);
68
69 internal:
70
71 struct Instance_State {
72 Proxy.Handle proxyHandle;
73 }
74
75 }
76 77 78
79