(int refnum)
| 233 | |
| 234 | // get returns an existing Ref to a Java object. |
| 235 | synchronized Ref get(int refnum) { |
| 236 | if (refnum < 0) { |
| 237 | throw new RuntimeException("ref called with Go refnum " + refnum); |
| 238 | } |
| 239 | if (refnum == NULL_REFNUM) { |
| 240 | return nullRef; |
| 241 | } |
| 242 | Ref ref = javaObjs.get(refnum); |
| 243 | if (ref == null) { |
| 244 | throw new RuntimeException("unknown java Ref: "+refnum); |
| 245 | } |
| 246 | return ref; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | // GoRefQueue is a queue of GoRefs that are no longer live. An internal thread |