|
138 | 138 |
|
139 | 139 | /***********************************************************************
|
140 | 140 | **
|
141 |
| -*/ REBINT Awake_System(REBSER *ports) |
| 141 | +*/ REBINT Awake_System(REBSER *ports, REBINT only) |
142 | 142 | /*
|
143 | 143 | ** Returns:
|
144 | 144 | ** -1 for errors
|
|
152 | 152 | REBVAL *waked;
|
153 | 153 | REBVAL *awake;
|
154 | 154 | REBVAL tmp;
|
| 155 | + REBVAL ref_only; |
155 | 156 | REBVAL *v;
|
156 | 157 |
|
157 | 158 | // Get the system port object:
|
|
177 | 178 | if (ports) Set_Block(&tmp, ports);
|
178 | 179 | else SET_NONE(&tmp);
|
179 | 180 |
|
| 181 | + if (only) SET_TRUE(&ref_only); |
| 182 | + else SET_NONE(&ref_only); |
180 | 183 | // Call the system awake function:
|
181 |
| - v = Apply_Func(0, awake, port, &tmp, 0); // ds is return value |
| 184 | + v = Apply_Func(0, awake, port, &tmp, &ref_only, 0); // ds is return value |
182 | 185 |
|
183 | 186 | // Awake function returns 1 for end of WAIT:
|
184 | 187 | return (IS_LOGIC(v) && VAL_LOGIC(v)) ? 1 : 0;
|
|
187 | 190 |
|
188 | 191 | /***********************************************************************
|
189 | 192 | **
|
190 |
| -*/ REBINT Wait_Ports(REBSER *ports, REBCNT timeout) |
| 193 | +*/ REBINT Wait_Ports(REBSER *ports, REBCNT timeout, REBINT only) |
191 | 194 | /*
|
192 | 195 | ** Inputs:
|
193 | 196 | ** Ports: a block of ports or zero (on stack to avoid GC).
|
|
211 | 214 | }
|
212 | 215 |
|
213 | 216 | // Process any waiting events:
|
214 |
| - if ((result = Awake_System(ports)) > 0) return TRUE; |
| 217 | + if ((result = Awake_System(ports, only)) > 0) return TRUE; |
215 | 218 |
|
216 | 219 | // If activity, use low wait time, otherwise increase it:
|
217 | 220 | if (result == 0) wt = 1;
|
|
0 commit comments