Agreed on the reason for the check in `ExecutionContextImpl`.

About the code in `ForkJoinTask`: it's explicitly permitted to create several instances of `ForkJoinPool`, so I trust that the internal `ForkJoinPool` logic ensures that no such check is necessary in this particular method.

From the doc comment it appears that this method is actually designed to really only be relevant to the current thread, regardless of the pool that the thread is part of, since it returns a task that is queued by the current thread (if any):

> Unschedules and returns, without executing, the next task
> queued by the current thread but not yet executed, if the
> current thread is operating in a ForkJoinPool.  This method is
> designed primarily to support extensions, and is unlikely to be
> useful otherwise.