1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 dcl lock_seg_ptr ptr;
16 dcl lock_transaction_table_ptr
17 ptr;
18 dcl lock_hash_table_ptr ptr;
19 dcl lock_aux_seg_ptr ptr;
20 dcl lock_block_ptr ptr;
21 dcl lock_block_array_ptr ptr;
22 dcl lock_free_block_ptr ptr;
23 dcl lock_object_ptr ptr;
24 dcl lock_owner_ptr ptr;
25 dcl lock_segments_ptr ptr;
26 dcl lock_waiter_ptr ptr;
27 dcl lock_deadlock_ptr ptr;
28
29 dcl n_lock_blocks fixed bin;
30 dcl n_lock_deadlock fixed bin;
31
32 dcl LOCK_SEG_VERSION_1 char (8) aligned init ("locksg 1") int static options (constant);
33
34 dcl 1 lock_seg aligned based (lock_seg_ptr),
35
36 2 version char (8) aligned,
37 2 header aligned,
38 3 lock fixed bin (71),
39 3 n_lock_segments fixed bin,
40 3 lock_seg_size fixed bin (19),
41 3 max_lock_segments fixed bin,
42 3 n_transaction_table_entries
43 fixed bin,
44 3 n_hash_table_entries
45 fixed bin,
46 3 hash_mask bit (36) aligned,
47 3 free_list_ptr aligned like lock_virtual_ptr,
48
49 3 transaction_table_offset
50 fixed bin (18) unsigned aligned,
51
52 3 hash_table_offset fixed bin (18) unsigned aligned,
53
54 3 n_lock_blocks fixed bin,
55 3 lock_array_offset fixed bin (18) unsigned aligned,
56
57 2 transaction_table (0 refer (lock_seg.n_transaction_table_entries)) aligned like lock_transaction_table,
58 2 hash_table aligned like lock_hash_table,
59 2 meters aligned like lock_meters,
60 2 free fixed bin (71);
61
62 dcl 1 lock_aux_seg aligned based (lock_aux_seg_ptr),
63
64 2 n_lock_blocks fixed bin,
65 2 lock_array_offset fixed bin (18) unsigned aligned,
66
67 2 free fixed bin (71);
68
69 dcl 1 lock_transaction_table aligned based (lock_transaction_table_ptr),
70
71 2 deadlock_inx fixed bin,
72 2 process_id bit (36) aligned,
73 2 txn_id bit (36) aligned,
74 2 ev_channel fixed bin (71),
75 2 own_ptr aligned like lock_virtual_ptr,
76
77 2 wait_ptr aligned like lock_virtual_ptr;
78
79
80 dcl 1 lock_hash_table aligned based (lock_hash_table_ptr),
81 2 buckets (lock_seg.n_hash_table_entries) aligned like lock_virtual_ptr;
82
83
84 dcl 1 lock_block aligned based (lock_block_ptr),
85
86 2 seg_inx fixed bin unal,
87 2 type fixed bin unal,
88 2 pad (5) bit (36) aligned;
89
90 dcl 1 lock_block_array (n_lock_blocks) aligned like lock_block based (lock_block_array_ptr);
91
92 dcl 1 lock_free_block aligned based (lock_free_block_ptr),
93
94 2 seg_inx fixed bin unal,
95 2 type fixed bin unal,
96 2 free_fp aligned like lock_virtual_ptr,
97
98 2 pad (4) bit (36) aligned;
99
100 dcl 1 lock_object aligned based (lock_object_ptr),
101
102 2 seg_inx fixed bin unal,
103 2 type fixed bin unal,
104 2 uid bit (36) aligned,
105 2 ci_no fixed bin (35),
106 2 owners_ptr aligned like lock_virtual_ptr,
107
108 2 waiters_ptr aligned like lock_virtual_ptr,
109
110 2 ht_fp aligned like lock_virtual_ptr;
111
112
113 dcl 1 lock_owner aligned based (lock_owner_ptr),
114
115 2 seg_inx fixed bin unal,
116 2 type fixed bin unal,
117 2 lock_ptr aligned like lock_virtual_ptr,
118
119 2 mode fixed bin,
120 2 owners_fp aligned like lock_virtual_ptr,
121
122 2 transaction_fp aligned like lock_virtual_ptr,
123
124 2 transaction_ptr aligned like lock_virtual_ptr;
125
126
127
128 dcl 1 lock_waiter aligned based (lock_waiter_ptr),
129
130 2 seg_inx fixed bin unal,
131 2 type fixed bin unal,
132 2 lock_ptr aligned like lock_virtual_ptr,
133
134 2 mode fixed bin,
135 2 waiters_fp aligned like lock_virtual_ptr,
136
137 2 transaction_ptr aligned like lock_virtual_ptr,
138
139 2 pad bit (36) aligned;
140
141
142 dcl 1 lock_segments aligned based (lock_segments_ptr),
143 2 seg_baseptr (lock_seg.n_lock_segments) ptr unal;
144
145 dcl 1 lock_virtual_ptr aligned based,
146 2 seg_inx fixed bin unal,
147 2 offset fixed bin (18) unsigned unal;
148
149 dcl 1 lock_deadlock aligned based (lock_deadlock_ptr),
150 2 wait_own (n_lock_deadlock, n_lock_deadlock) bit (1) unaligned;
151
152 declare 1 lock_deadlock_36 aligned based (lock_deadlock_ptr),
153 2 wait_own (36, 36) bit (1) unaligned;
154
155 declare 1 lock_deadlock_72 aligned based (lock_deadlock_ptr),
156 2 wait_own (72, 72) bit (1) unaligned;
157
158
159 declare lock_deadlock_txn_ids_ptr
160 pointer;
161 declare lock_deadlock_txn_ids (n_lock_deadlock) bit (36) aligned based (lock_deadlock_txn_ids_ptr);
162 dcl (
163 TYPE_FREE init (1),
164 TYPE_OBJECT init (2),
165 TYPE_OWNER init (3),
166 TYPE_WAITER init (4),
167 MAX_TYPE init (4)
168 ) fixed bin int static options (constant);
169
170
171 dcl 1 NULL_VPTR aligned int static options (constant),
172 2 seg_inx fixed bin unal init (-1),
173 2 offset fixed bin (18) unsigned unal init (0);
174
175
176 dcl LOCK_BLOCK_SIZE fixed bin int static options (constant) init (6);
177
178
179 dcl LOCK_SEGNAME char (9) int static options (constant) init ("lock_seg_");
180
181 dcl lock_segno pic "999";
182
183 dcl (
184 LOCK_MESSAGE_DEADLOCK init (1243657)
185 ) fixed bin (71) int static options (constant);
186
187
188