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.ISemProcessSupport;
20
21 /*!
22 * ======== SemProcess ========
23 * SemProcess Manager
24 *
25 * This module manages multi-process semaphores through its proxy
26 * ISemProcessSupport 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 SemProcess = xdc.useModule('xdc.runtime.knl.SemProcess');
35 * SemProcess.Proxy = xdc.useModule('ti.sysbios.xdcruntime.SemProcessSupport');
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
47 @InstanceFinalize
48
49 module SemProcess inherits ISemaphore
50 {
51
52 /*! Proxy that needs to be bound to an OS specific delegate. */
53 proxy Proxy inherits ISemProcessSupport;
54
55 instance:
56
57 /*!
58 * ======== create ========
59 * Create a SemProcess object
60 *
61 * This function creates a new `SemProcess` object which is initialized to
62 * count. All semaphores created with the same key reference the same
63 * underlying synchronization object and work between processes.
64 *
65 * @param(count) initial semaphore count
66 * @param(key) globally unique key for SysV-style semaphore
67 */
68 create(Int count, UInt32 key);
69
70 internal:
71
72 struct Instance_State {
73 Proxy.Handle proxyHandle;
74 }
75 }
76 77 78
79