Categories
5G Network
Agile
Amazon EC2
Android
Angular
Ansible
Arduino
Artificial Intelligence
Augmented Reality
AWS
Azure
Big Data
Blockchain
BootStrap
Cache Teachniques
Cassandra
Commercial Insurance
C#
C++
Cloud
CD
CI
Cyber Security
Data Handling
Data using R
Data Science
DBMS
Design-Pattern
DevOps
ECMAScript
Fortify
Ethical Hacking
Framework
GIT
GIT Slack
Gradle
Hadoop
HBase
HDFS
Hibernate
Hive
HTML
Image Processing
IOT
JavaScript
Java
Jenkins
Jira
JUnit
Kibana
Linux
Machine Learning
MangoDB
MVC
NGINX
Onsen UI
Oracle
PHP
Python
QTP
R Language
Regression Analysis
React JS
Robotic
Salesforce
SAP
Selenium
Service Discovery
Service Now
SOAP UI
Spark SQL
Testing
TOGAF
Research Method
Virtual Reality
Vue.js
Home
Recent Q&A
Feedback
Ask a Question
Why to use lock statement in C#?
Home
>
C Sharp
>
Why to use lock statement in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
Q:
Why to use lock statement in C#?
lock-statement
statement-in-c#
Answer
1
Answer
0
votes
answered
Oct 18, 2019
by
rajeshsharma
Lock will make sure one thread will not intercept the other thread which is running the part of code. So lock statement will make the thread wait, block till the object is being released.
Click here to read more about Loan/Mortgage
Click here to read more about Insurance
Many hands make light work, Share it here
Facebook
Twitter
LinkedIn
Reddit
Related questions
0
votes
Q: What is the lock statement in C#?
asked
May 6, 2020
in
C Sharp
by
SakshiSharma
#lock-statement
0
votes
Q: Why to use “Nullable Coalescing Operator” (??) in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
c#-nullable
nullable-in-c#
0
votes
Q: Why to use “finally” block in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
finally-c#
c#-finally
0
votes
Q: Why to use keyword “const” in C#? Give an example.
asked
Oct 18, 2019
in
C Sharp
by
Robin
const-in-c#
c#-in-const
0
votes
Q: Why to use “using” in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
using-in-c#
c#-using
0
votes
Q: In try block if we add return statement whether finally block is executed in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
c#
0
votes
Q: Whats the C# equivalent of C++ catch ( ), which was a catch-all statement for any possible exception?
asked
Mar 5, 2020
in
C Sharp
by
JackTerrance
0
votes
Q: What are the main reasons to use C# language?
asked
May 6, 2020
in
C Sharp
by
SakshiSharma
#reason-c#
#c#-reason
#c-sharp-reason
+1
vote
Q: What is the use of using statement in C#?
asked
Jun 25, 2019
in
Dot Net
by
Venkatshastri
#c#
#dotnet
0
votes
Q: Why to use “finally” block in C-Sharp?
asked
Feb 16, 2020
in
C Sharp
by
rahuljain1
#c-sharp-finally
0
votes
Q: Reserved keywords can be use as identifiers in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Can we use delegates for asynchronous method calls in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
c#-delegates
delegates
0
votes
Q: Can we use “this” inside a static method in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
this-c#
c#-this
0
votes
Q: Why do we use import statement?
asked
Nov 29, 2019
in
Machine Learning
by
SakshiSharma
#import-statement
0
votes
Q: Which statment converts a type to a Boolean value, where possible in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Which statment converts a type to a byte value in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Which statment converts a type to a single Unicode character, where possible in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Which statment converts a floating point or integer type to a decimal type in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Which statment converts a type to a double type in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#c#
#csharp
0
votes
Q: Which statment converts a type to a 16-bit integer in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#c#
#csharp
0
votes
Q: Which statment converts a type to a 32-bit integer in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
csharp
c#
+1
vote
Q: Name some of the most common places to look for a Deadlock in C#.
asked
Apr 9, 2020
in
C Sharp
by
GeorgeBell
#common-questions-answers
0
votes
Q: Write a sample code to write the contents to text file in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
text-file
0
votes
Q: How to check whether hash table contains specific key in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
specific-key-in-c#
0
votes
Q: The ______ command is used to set a lock in string dataset
asked
Feb 16, 2020
in
JAVA
by
rahuljain1
#dataset
0
votes
Q: Which keyword is used for including the namespaces in the program in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Which statment is correct about variable naming conventions in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Which statment is correct about variable naming conventions in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Which statment is a reserved keyword in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Which statment is a contextual keyword in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
...