Skip to content

Commit

Permalink
Add missing documentation to API exposed by commit 71a7632
Browse files Browse the repository at this point in the history
  • Loading branch information
mpfaff committed Aug 10, 2024
1 parent 57b4b29 commit b85e357
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/java.base/share/classes/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ sealed interface OfVirtual extends Builder

/**
* Sets the scheduler.
* @param scheduler
* @param scheduler scheduler
* @return this builder
*/
OfVirtual scheduler(Executor scheduler);
Expand Down Expand Up @@ -1515,7 +1515,8 @@ public static Thread startVirtualThread(Runnable task, Executor scheduler) {
}

/**
* Keeps the current thread pinned until {@linkplain #close() closed}. Returned by {@link #pinCarrierThread()}.
* Keeps the current thread pinned to its carrier thread until {@linkplain #close() closed}. Returned by
* {@link #pinToCarrierThread()}.
*/
public static final class CarrierThreadPin implements AutoCloseable {
/**
Expand Down Expand Up @@ -1548,9 +1549,12 @@ public void close() {

/**
* Disallow the current thread be suspended or preempted until the returned pin is
* {@linkplain CarrierThreadPin#close() closed}.
* {@linkplain CarrierThreadPin#close() closed}. This operation has no effect on platform threads, and the returned
* pin may skip correctness checks in these cases.
*
* @return a new pin that must be closed to unpin the thread
*/
public static CarrierThreadPin pinCarrierThread() {
public static CarrierThreadPin pinToCarrierThread() {
if (!(Thread.currentThread() instanceof VirtualThread thread)) {
return new CarrierThreadPin(null);
}
Expand Down

0 comments on commit b85e357

Please sign in to comment.