< prev index next > src/java.base/share/classes/jdk/internal/misc/Blocker.java
Print this page
* Marks the beginning of a possibly blocking operation.
* @return the return value from the attempt to compensate or -1 if not attempted
*/
public static long begin() {
if (VM.isBooted()
+ && Thread.currentThread().isVirtual()
&& currentCarrierThread() instanceof CarrierThread ct && !ct.inBlocking()) {
ct.beginBlocking();
boolean completed = false;
try {
long comp = ForkJoinPools.beginCompensatedBlock(ct.getPool());
< prev index next >