jakartaee / concurrency

Eclipse Project for Concurrency Utilities
https://projects.eclipse.org/projects/ee4j.cu
Other
69 stars 38 forks source link

ManagedThreadFactory javadoc and spec discrepancy regarding ManageableThread #32

Open glassfishrobot opened 11 years ago

glassfishrobot commented 11 years ago

Section 3.4.4 of the spec says: Threads returned by the newThread() method must implement the ManageableThread interface.

but javadoc says: Threads returned from the newThread() method should implement the ManageableThread interface.

The spec is correct. The javadoc needs to be updated to say Threads returned from the newThread() method must implement the ManageableThread interface.

Affected Versions

[1.0]

glassfishrobot commented 6 years ago
glassfishrobot commented 11 years ago

@glassfishrobot Commented Reported by alai8

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA CONCURRENCY_EE_SPEC-32

njr-11 commented 1 year ago

The requirement to implement ManageableThread will not be achievable when creating virtual threads. Java requires a Thread.Builder to create virtual threads (or Thread.startVirtualThread which is defined as delegating to the builder via Thread.ofVirtual()) and seals the Thread.Builder interface to enforce that the only builders permitted are Thread.Builder.OfPlatform or Thread.Builder.OfVirtual which do not allow adding the ManageableThread interface to the Thread implementation class.

So in addition to fixing the existing inconsistency in the spec, we will also need to do something like qualifying the requirement as being for platform threads only.