Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from jentfoo/concurrency_classpath_extension
Adding more java.util.concurrent interfaces that were missed previously.
- Loading branch information
Showing
5 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package java.util.concurrent; | ||
|
||
import java.util.Collection; | ||
import java.util.Queue; | ||
|
||
public interface BlockingQueue<T> extends Queue<T> { | ||
public void put(T e) throws InterruptedException; | ||
|
||
public boolean offer(T e, long timeout, TimeUnit unit) throws InterruptedException; | ||
|
||
public T take() throws InterruptedException; | ||
|
||
public T poll(long timeout, TimeUnit unit) throws InterruptedException; | ||
|
||
public int remainingCapacity(); | ||
|
||
public int drainTo(Collection<? super T> c); | ||
|
||
public int drainTo(Collection<? super T> c, int maxElements); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package java.util.concurrent; | ||
|
||
public interface CompletionService<T> { | ||
public Future<T> submit(Callable<T> task); | ||
|
||
public Future<T> submit(Runnable task, T result); | ||
|
||
public Future<T> take() throws InterruptedException; | ||
|
||
public Future<T> poll(); | ||
|
||
public Future<T> poll(long timeout, TimeUnit unit) throws InterruptedException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package java.util.concurrent; | ||
|
||
public interface RunnableFuture<T> extends Runnable, Future<T> { | ||
// nothing added to interface | ||
} |
19 changes: 19 additions & 0 deletions
19
classpath/java/util/concurrent/ScheduledExecutorService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package java.util.concurrent; | ||
|
||
public interface ScheduledExecutorService extends ExecutorService { | ||
public ScheduledFuture<?> schedule(Runnable command, | ||
long delay, TimeUnit unit); | ||
|
||
public <V> ScheduledFuture<V> schedule(Callable<V> callable, | ||
long delay, TimeUnit unit); | ||
|
||
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, | ||
long initialDelay, | ||
long period, | ||
TimeUnit unit); | ||
|
||
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, | ||
long initialDelay, | ||
long delay, | ||
TimeUnit unit); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package java.util.concurrent; | ||
|
||
public interface ThreadFactory { | ||
public Thread newThread(Runnable r); | ||
} |