Title: Codes · Issue #176 · ActiveState/code · GitHub
Open Graph Title: Codes · Issue #176 · ActiveState/code
X Title: Codes · Issue #176 · ActiveState/code
Description: public class SynchronizedCounter { private int count = 0; // The synchronized keyword ensures that only one thread can execute this method at a time public synchronized void increment() { count++; } public synchronized int getCount() { r...
Open Graph Description: public class SynchronizedCounter { private int count = 0; // The synchronized keyword ensures that only one thread can execute this method at a time public synchronized void increment() { count++; ...
X Description: public class SynchronizedCounter { private int count = 0; // The synchronized keyword ensures that only one thread can execute this method at a time public synchronized void increment() { count++; ...
Opengraph URL: https://github.com/ActiveState/code/issues/176
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Codes","articleBody":"public class SynchronizedCounter {\n private int count = 0;\n\n // The synchronized keyword ensures that only one thread can execute this method at a time\n public synchronized void increment() {\n count++;\n }\n\n public synchronized int getCount() {\n return count;\n }\n}\n\npublic class CounterTest {\n public static void main(String[] args) throws InterruptedException {\n SynchronizedCounter counter = new SynchronizedCounter();\n \n // Create two threads that increment the counter 1000 times each\n Thread t1 = new Thread(() -\u003e {\n for (int i = 0; i \u003c 1000; i++) {\n counter.increment();\n }\n });\n\n Thread t2 = new Thread(() -\u003e {\n for (int i = 0; i \u003c 1000; i++) {\n counter.increment();\n }\n });\n\n t1.start();\n t2.start();\n\n // Wait for both threads to complete\n t1.join();\n t2.join();\n\n System.out.println(\"Final count: \" + counter.getCount()); // Should be 2000\n }\n}\n","author":{"url":"https://github.com/siddharthrgade21-a11y","@type":"Person","name":"siddharthrgade21-a11y"},"datePublished":"2025-12-20T03:48:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/176/code/issues/176"}
| 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:e9d027f8-bbf7-86fa-93c0-2f2635033ea5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94EA:29F2E0:AAA30:DD8FF:6969602A |
| html-safe-nonce | c186d5df328bc05f62588a62ce90685e6f57e35dd2a65dc3c31188be2e29a72d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEVBOjI5RjJFMDpBQUEzMDpERDhGRjo2OTY5NjAyQSIsInZpc2l0b3JfaWQiOiI0MDE2MTE3NTU1MzkzMDI4MTM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0a31eaeacff1a6c7b16264b31a74dcfeb0174fb167c739c2e06d66db801d17a5 |
| hovercard-subject-tag | issue:3749504566 |
| 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/ActiveState/code/176/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b00f62ed502f0367ce9d63b19e72806be165689c930e3f2d21c3b4063c71d0f0/ActiveState/code/issues/176 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b00f62ed502f0367ce9d63b19e72806be165689c930e3f2d21c3b4063c71d0f0/ActiveState/code/issues/176 |
| og:image:alt | public class SynchronizedCounter { private int count = 0; // The synchronized keyword ensures that only one thread can execute this method at a time public synchronized void increment() { count++; ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | siddharthrgade21-a11y |
| hostname | github.com |
| expected-hostname | github.com |
| None | 48487c1ad776a7975b7132d95f4240ff3ae37cd5b8e3cb597102a4edb76738f1 |
| turbo-cache-control | no-preview |
| go-import | github.com/ActiveState/code git https://github.com/ActiveState/code.git |
| octolytics-dimension-user_id | 319781 |
| octolytics-dimension-user_login | ActiveState |
| octolytics-dimension-repository_id | 98225960 |
| octolytics-dimension-repository_nwo | ActiveState/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 98225960 |
| octolytics-dimension-repository_network_root_nwo | ActiveState/code |
| 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 | 669463fcc54773a88c1f5a44eef6b99a5504b9c7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width