Click here to Skip to main content
15,889,808 members
Home / Discussions / C#
   

C#

 
QuestionNullable Type Pin
Mycroft Holmes17-Aug-09 13:20
professionalMycroft Holmes17-Aug-09 13:20 
AnswerRe: Nullable Type Pin
Christian Graus17-Aug-09 13:39
protectorChristian Graus17-Aug-09 13:39 
AnswerRe: Nullable Type Pin
Henry Minute17-Aug-09 13:59
Henry Minute17-Aug-09 13:59 
GeneralRe: Nullable Type Pin
Mycroft Holmes17-Aug-09 14:12
professionalMycroft Holmes17-Aug-09 14:12 
QuestionPointless locking? Pin
MarkLTX17-Aug-09 11:38
MarkLTX17-Aug-09 11:38 
AnswerRe: Pointless locking? Pin
Christian Graus17-Aug-09 11:49
protectorChristian Graus17-Aug-09 11:49 
AnswerRe: Pointless locking? Pin
PIEBALDconsult17-Aug-09 13:17
mvePIEBALDconsult17-Aug-09 13:17 
AnswerRe: Pointless locking? Pin
cmk17-Aug-09 18:34
cmk17-Aug-09 18:34 
Given something like:
class c {
  _locker;
  _memberString;
  f() {
    ...
    lock(_locker) {
      return _memberString;
    }
  }
}
caller() {
  c v;
  ...
  s = v.f();
}


In s = v.f() _memberString will need to be copied to a temp variable, or directly to s, before f returns. By locking the return you ensure that _memberString isn't modified in mid-copy ... or at least that's the way I would expect it to work in lieu of documentation to the contrary.

...cmk

The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack

GeneralRe: Pointless locking? Pin
MarkLTX18-Aug-09 3:21
MarkLTX18-Aug-09 3:21 
QuestionArray of class with implicit conversion [modified] Pin
DaveyM6917-Aug-09 11:23
professionalDaveyM6917-Aug-09 11:23 
AnswerRe: Array of class with implicit conversion Pin
Saksida Bojan17-Aug-09 11:32
Saksida Bojan17-Aug-09 11:32 
GeneralRe: Array of class with implicit conversion Pin
DaveyM6917-Aug-09 11:37
professionalDaveyM6917-Aug-09 11:37 
GeneralRe: Array of class with implicit conversion Pin
Luc Pattyn17-Aug-09 13:08
sitebuilderLuc Pattyn17-Aug-09 13:08 
AnswerRe: Array of class with implicit conversion Pin
PIEBALDconsult17-Aug-09 13:19
mvePIEBALDconsult17-Aug-09 13:19 
Questionaccessing control's value from a seperate class. Pin
JollyMansArt17-Aug-09 11:07
JollyMansArt17-Aug-09 11:07 
AnswerRe: accessing control's value from a seperate class. Pin
Saksida Bojan17-Aug-09 11:15
Saksida Bojan17-Aug-09 11:15 
AnswerRe: accessing control's value from a seperate class. Pin
MarkLTX17-Aug-09 11:29
MarkLTX17-Aug-09 11:29 
AnswerRe: accessing control's value from a seperate class. Pin
DaveyM6917-Aug-09 11:32
professionalDaveyM6917-Aug-09 11:32 
QuestionRe: accessing control's value from a seperate class. [modified] What am I doing wrong? Pin
JollyMansArt17-Aug-09 11:45
JollyMansArt17-Aug-09 11:45 
QuestionRe: accessing control's value from a seperate class. [modified] What am I doing wrong? Pin
JollyMansArt17-Aug-09 12:07
JollyMansArt17-Aug-09 12:07 
AnswerRe: accessing control's value from a seperate class. [modified] What am I doing wrong? Pin
DaveyM6917-Aug-09 12:20
professionalDaveyM6917-Aug-09 12:20 
QuestionRe: accessing control's value from a seperate class. [modified] What am I doing wrong? (Simplified...) Pin
JollyMansArt17-Aug-09 12:32
JollyMansArt17-Aug-09 12:32 
AnswerRe: accessing control's value from a seperate class. [modified] What am I doing wrong? Pin
Henry Minute17-Aug-09 12:57
Henry Minute17-Aug-09 12:57 
AnswerRe: accessing control's value from a seperate class. Pin
Luc Pattyn17-Aug-09 13:13
sitebuilderLuc Pattyn17-Aug-09 13:13 
QuestionForm reload Pin
neha_rai17-Aug-09 9:27
neha_rai17-Aug-09 9:27 

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.