Click here to Skip to main content
15,896,118 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Anonymous Methods Pin
Judah Gabriel Himango8-Nov-06 6:05
sponsorJudah Gabriel Himango8-Nov-06 6:05 
GeneralRe: C# Anonymous Methods Pin
Jamie Nordmeyer8-Nov-06 9:25
Jamie Nordmeyer8-Nov-06 9:25 
GeneralRe: C# Anonymous Methods Pin
Judah Gabriel Himango8-Nov-06 12:40
sponsorJudah Gabriel Himango8-Nov-06 12:40 
GeneralRe: C# Anonymous Methods Pin
Jamie Nordmeyer8-Nov-06 12:53
Jamie Nordmeyer8-Nov-06 12:53 
GeneralRe: C# Anonymous Methods Pin
Judah Gabriel Himango8-Nov-06 13:11
sponsorJudah Gabriel Himango8-Nov-06 13:11 
GeneralRe: C# Anonymous Methods Pin
Jamie Nordmeyer8-Nov-06 13:29
Jamie Nordmeyer8-Nov-06 13:29 
QuestionWMI and restricted user rights Pin
mav.northwind8-Nov-06 5:46
mav.northwind8-Nov-06 5:46 
Questionlock() and return statements: Pin
tomerico8-Nov-06 5:34
tomerico8-Nov-06 5:34 
Hi
Are the 2 pieces of code equivalent in terms of thread safety?

<br />
		DateTime Date{<br />
			get	{<br />
				lock (this)	{<br />
					return date;<br />
				}<br />
			}<br />
			set	{<br />
				lock (this)	{<br />
					date = value;<br />
				}<br />
			}<br />
		}<br />

<br />
		DateTime Date {<br />
			get	{<br />
				DateTime tempDate;<br />
				lock (this)	{<br />
					tempDate = date;<br />
				}<br />
				retirm tempDate<br />
			}<br />
			set	{<br />
				lock (this)	{<br />
					date = value;<br />
				}<br />
			}<br />
		}<br />


Because it'd be nice to avoid the extra boilerplate code, and simply return the value.

(In other words I ask whether the return value is copied before or after the finally block)
AnswerRe: lock() and return statements: Pin
Andrew Rissing8-Nov-06 10:56
Andrew Rissing8-Nov-06 10:56 
GeneralThreadSafety Pin
tomerico8-Nov-06 19:05
tomerico8-Nov-06 19:05 
GeneralRe: ThreadSafety Pin
Andrew Rissing9-Nov-06 3:31
Andrew Rissing9-Nov-06 3:31 
Questionpublish my project Pin
daniel998-Nov-06 5:24
daniel998-Nov-06 5:24 
AnswerRe: publish my project Pin
ejuanpp8-Nov-06 5:50
ejuanpp8-Nov-06 5:50 
QuestionWindows-Application terminates abnormally Pin
Daniel_at_Scania8-Nov-06 5:19
Daniel_at_Scania8-Nov-06 5:19 
AnswerRe: Windows-Application terminates abnormally Pin
ejuanpp8-Nov-06 5:27
ejuanpp8-Nov-06 5:27 
GeneralRe: Windows-Application terminates abnormally Pin
Daniel_at_Scania10-Nov-06 1:30
Daniel_at_Scania10-Nov-06 1:30 
GeneralRe: Windows-Application terminates abnormally Pin
ejuanpp10-Nov-06 3:38
ejuanpp10-Nov-06 3:38 
QuestionCall back method for threads Pin
pranu_138-Nov-06 5:18
pranu_138-Nov-06 5:18 
AnswerRe: Call back method for threads Pin
Robert Rohde8-Nov-06 6:22
Robert Rohde8-Nov-06 6:22 
AnswerRe: Call back method for threads Pin
Eric Dahlvang8-Nov-06 8:15
Eric Dahlvang8-Nov-06 8:15 
GeneralNot sure how it fits BUT Pin
Just me at will_george...something8-Nov-06 4:25
Just me at will_george...something8-Nov-06 4:25 
GeneralRe: Not sure how it fits BUT Pin
Pete O'Hanlon9-Nov-06 4:20
mvePete O'Hanlon9-Nov-06 4:20 
QuestionThreading Conversion Pin
eatwork8-Nov-06 4:17
eatwork8-Nov-06 4:17 
AnswerRe: Threading Conversion Pin
led mike8-Nov-06 5:30
led mike8-Nov-06 5:30 
GeneralRe: Threading Conversion Pin
eatwork8-Nov-06 12:24
eatwork8-Nov-06 12:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.