Skip to content

Fix | Fix SharedTimer implementation to use class level lock for thread safety#1046

Merged
cheenamalhotra merged 3 commits intomicrosoft:devfrom
cheenamalhotra:sharedTimerThreadSafety
May 15, 2019
Merged

Fix | Fix SharedTimer implementation to use class level lock for thread safety#1046
cheenamalhotra merged 3 commits intomicrosoft:devfrom
cheenamalhotra:sharedTimerThreadSafety

Conversation

@cheenamalhotra
Copy link
Copy Markdown
Member

Fixes #1040

Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SharedTimer.java Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SharedTimer.java Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SharedTimer.java Outdated
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SharedTimer.java Outdated
@sehrope
Copy link
Copy Markdown
Contributor

sehrope commented Apr 24, 2019

The static isRunning() method should be updated to use the explicit lock object as well.

@sehrope
Copy link
Copy Markdown
Contributor

sehrope commented Apr 24, 2019

Actually maybe it doesn't need the explicit synchronized lock at all as it's accessing the volatile field.

The method level synchronized can be removed though as the only thing it would be synchronizing is concurrent callers to that one method.

@cheenamalhotra cheenamalhotra added this to the 7.3.1 milestone Apr 25, 2019
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SharedTimer.java
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SharedTimer.java
Comment thread src/main/java/com/microsoft/sqlserver/jdbc/SharedTimer.java
@cheenamalhotra cheenamalhotra merged commit 6c1b4b3 into microsoft:dev May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hikari + MSSQL 7.2.1 having issues

7 participants