MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / leave

Method leave

src/main/java/field/app/ThreadSync.java:149–163  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

147 }
148
149 static public void leave(Object o) throws InterruptedException, Stop {
150 if (fiber.get() == null)
151 throw new IllegalArgumentException(" yield called from non-fiber thread");
152
153 fiber.get().debugStatus = "leave from " + Arrays.asList(new Exception().getStackTrace());
154
155 if (fiber.get().stopped) throw new Stop();
156 if (o == null) o = NULL;
157
158 Object t = fiber.get().input.poll();
159 fiber.get().output.offer(o);
160
161 if (fiber.get().stopped) throw new Stop();
162
163 }
164
165 static public void leaveFor(int n, Object o) throws InterruptedException, Stop {
166 for (int i = 0; i < n; i++) {

Callers 1

leaveForMethod · 0.95

Calls 3

asListMethod · 0.80
getMethod · 0.65
pollMethod · 0.45

Tested by

no test coverage detected