07.03.2014 Views

Programowanie współbieżne w języku Java

Programowanie współbieżne w języku Java

Programowanie współbieżne w języku Java

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

package prodcons04;<br />

import java.util.concurrent.Semaphore;<br />

public class SemaphoreBoundedBuffer {<br />

private final Semaphore availableItems, availableSpaces;<br />

private final E[] items;<br />

private int putPosition = 0, takePosition = 0;<br />

public SemaphoreBoundedBuffer(int capacity) {<br />

if (capacity

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!