A
Alexander Muylaert
Hi
when browsing thrue someone's code, I noticed the following lock mechanism.
Why would someone do it that way?
public class..
private readonly object _Lock = new object();
public int Count {
get {
lock(_Lock) {
return _List.Count;
}
}
Why not just
Lock(this){
return _List.Count;
}
Can somebody give me a clue?
Kind regards
Alexander
when browsing thrue someone's code, I noticed the following lock mechanism.
Why would someone do it that way?
public class..
private readonly object _Lock = new object();
public int Count {
get {
lock(_Lock) {
return _List.Count;
}
}
Why not just
Lock(this){
return _List.Count;
}
Can somebody give me a clue?
Kind regards
Alexander