Title: Unnecessary use of volatile · Issue #2 · callicoder/java-snowflake · GitHub
Open Graph Title: Unnecessary use of volatile · Issue #2 · callicoder/java-snowflake
X Title: Unnecessary use of volatile · Issue #2 · callicoder/java-snowflake
Description: @callicoder The entire nextId() method is synchronized! Why do we need a volatile still? private volatile long lastTimestamp = -1L; private volatile long sequence = 0L; public synchronized long nextId() { }
Open Graph Description: @callicoder The entire nextId() method is synchronized! Why do we need a volatile still? private volatile long lastTimestamp = -1L; private volatile long sequence = 0L; public synchronized long nex...
X Description: @callicoder The entire nextId() method is synchronized! Why do we need a volatile still? private volatile long lastTimestamp = -1L; private volatile long sequence = 0L; public synchronized long nex...
Opengraph URL: https://github.com/callicoder/java-snowflake/issues/2
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unnecessary use of volatile","articleBody":"@callicoder The entire nextId() method is synchronized! Why do we need a volatile still?\r\n\r\nprivate volatile long lastTimestamp = -1L;\r\nprivate volatile long sequence = 0L;\r\n\r\n\r\npublic synchronized long nextId() {\r\n}","author":{"url":"https://github.com/syedfaisal3","@type":"Person","name":"syedfaisal3"},"datePublished":"2023-02-13T06:50:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2/java-snowflake/issues/2"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5e6e1a5d-6797-d8e1-9589-b8cabd1e5327 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9464:263D08:459FC32:5ECBA29:697CA3F3 |
| html-safe-nonce | bc83c70dfa323d248244cc7662dba510e87f11a8ce4478326621d9e9a9f81055 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDY0OjI2M0QwODo0NTlGQzMyOjVFQ0JBMjk6Njk3Q0EzRjMiLCJ2aXNpdG9yX2lkIjoiMzA2ODg5NzQzNjM0NTYwNzE1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7e502382f66a82e58809882b50c8d03de14f88561412a37dba4828ccd9385d2c |
| hovercard-subject-tag | issue:1581766019 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/callicoder/java-snowflake/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6dc97b4582cb257b351683bfdb1bf00d3af77782429907ef7ccf654f25e98534/callicoder/java-snowflake/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6dc97b4582cb257b351683bfdb1bf00d3af77782429907ef7ccf654f25e98534/callicoder/java-snowflake/issues/2 |
| og:image:alt | @callicoder The entire nextId() method is synchronized! Why do we need a volatile still? private volatile long lastTimestamp = -1L; private volatile long sequence = 0L; public synchronized long nex... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | syedfaisal3 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5bdfd06d077d4bc79a8063f7549f208cda3158f1322903029653dc97f57b937a |
| turbo-cache-control | no-preview |
| go-import | github.com/callicoder/java-snowflake git https://github.com/callicoder/java-snowflake.git |
| octolytics-dimension-user_id | 8003566 |
| octolytics-dimension-user_login | callicoder |
| octolytics-dimension-repository_id | 157973857 |
| octolytics-dimension-repository_nwo | callicoder/java-snowflake |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 157973857 |
| octolytics-dimension-repository_network_root_nwo | callicoder/java-snowflake |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8a309d88087f59ff1a2f2cd9e9e79ed01a7b84e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width