Bug #110512 Contribution: Replace synchronized with ReentrantLock
Submitted: 27 Mar 2023 14:19 Modified: 9 Apr 17:11
Reporter: OCA Admin (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[27 Mar 2023 14:19] OCA Admin
Description:
This bug tracks a contribution by Bart De Neuter (Github user: bdeneuter) as described in http://github.com/mysql/mysql-connector-j/pull/95

How to repeat:
See description

Suggested fix:
See contribution code attached
[27 Mar 2023 14:19] OCA Admin
Contribution submitted via Github - Replace synchronized with ReentrantLock 
(*) Contribution by Bart De Neuter (Github bdeneuter, mysql-connector-j/pull/95#issuecomment-1482985515): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_1289073556.txt (text/plain), 498.25 KiB.

[27 Mar 2023 14:22] MySQL Verification Team
Hello Bart De Neuter,

Thank you for the report and contribution.

regards,
Umesh
[25 Aug 2023 11:28] Bart De Neuter
Hi, as virtual threads are being released in a few weeks as part of JDK 21, I was wondering what the status was from this ticket?
[9 Nov 2023 17:13] Paul Carter-Brown
+1 for this pinning to be resolved. This is preventing our adoption of virtual threads.
[12 Mar 12:57] Filipe Silva
Supersedes Bug#109346, Bug#109554 and Bug#109713.
[9 Apr 17:11] Daniel So
Posted by developer:
 
Added the following to the Connector/J 9.0.0 changelog: 

"Synchronized blocks in the Connector/J code were replaced with ReentrantLocks. This allows carrier threads to unmount virtual threads when they are waiting on IO operations, making Connector/J virtual-thread friendly. Thanks to Bart De Neuter for contributing to this patch. "