{"id":20605183,"url":"https://github.com/arnab-developer/lock-example","last_synced_at":"2026-04-16T21:33:47.587Z","repository":{"id":68915286,"uuid":"276815592","full_name":"Arnab-Developer/lock-example","owner":"Arnab-Developer","description":"Example of lock with multiple thread with C#.","archived":false,"fork":false,"pushed_at":"2021-04-09T11:54:10.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-17T02:24:17.546Z","etag":null,"topics":["lock","multithreading"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arnab-Developer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-03T05:30:43.000Z","updated_at":"2021-12-05T05:48:17.000Z","dependencies_parsed_at":"2023-05-25T14:00:41.965Z","dependency_job_id":null,"html_url":"https://github.com/Arnab-Developer/lock-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2Flock-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2Flock-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2Flock-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2Flock-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arnab-Developer","download_url":"https://codeload.github.com/Arnab-Developer/lock-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242250932,"owners_count":20096895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lock","multithreading"],"created_at":"2024-11-16T09:26:57.921Z","updated_at":"2026-04-16T21:33:42.557Z","avatar_url":"https://github.com/Arnab-Developer.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Use of `lock` in multithreading\n\nThis is a demo to show the use of `lock` in multithreading with C#.\n\nThere are two methods in class `LockExample.Lib.Utilities.SomeUtility`. One is with `lock` and another without.\n\n```c#\npublic void PerformSomeOperationWithLock(InputOutputValue inputOutputValues)\n{\n    lock (this)\n    {\n        // code here...\n    }\n}\n\npublic void PerformSomeOperationWithNoLock(InputOutputValue inputOutputValues)\n{\n    // code here...\n}\n```\n\nThere are two test cases are written for each of these in class `LockExample.Test.SomeUtilityTest` to show the operation difference.\n\n```c#\n[Fact]\npublic void PerformSomeOperationWithLockTest()\n{\n    // code here...\n}\n\n[Fact]\npublic void PerformSomeOperationWithNoLockTest()\n{\n    // code here...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnab-developer%2Flock-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnab-developer%2Flock-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnab-developer%2Flock-example/lists"}