Click here to Skip to main content
16,006,341 members
Home / Discussions / C#
   

C#

 
GeneralRe: Mutex Not Working Pin
jan larsen9-Aug-05 2:17
jan larsen9-Aug-05 2:17 
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 2:36
Dwayner799-Aug-05 2:36 
GeneralRe: Mutex Not Working Pin
jan larsen9-Aug-05 2:08
jan larsen9-Aug-05 2:08 
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 2:27
Dwayner799-Aug-05 2:27 
GeneralRe: Mutex Not Working Pin
jan larsen9-Aug-05 3:07
jan larsen9-Aug-05 3:07 
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 3:31
Dwayner799-Aug-05 3:31 
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 3:55
Dwayner799-Aug-05 3:55 
GeneralRe: Mutex Not Working Pin
jan larsen9-Aug-05 4:02
jan larsen9-Aug-05 4:02 
It's the second method call that's the problem. No mutex, monitor or lock statement can help you here as they are all concerned about threading.
But the output clearly says that you're running multithreaded. The lockedFunction2() invocation will not execute before lockedFunction1() is finished. To get the output you display, lockedFunction1(), lockedFunction2() or both must start another thread that outputs the text.
To test for this you could make this change to the output routine:

Console.WriteLine("function 1 entered in thread: " + System.Threading.Thread.CurrentThread.GetHashCode() );


if the hashcode differs in the output, then it's another thread. If it doesn't, then call an Exorcist Smile | :)

"God doesn't play dice" - Albert Einstein

"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 4:19
Dwayner799-Aug-05 4:19 
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 4:42
Dwayner799-Aug-05 4:42 
GeneralRe: Mutex Not Working Pin
jan larsen9-Aug-05 8:53
jan larsen9-Aug-05 8:53 
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 11:17
Dwayner799-Aug-05 11:17 
GeneralC# Video Pin
magnifique8-Aug-05 6:30
magnifique8-Aug-05 6:30 
GeneralRe: C# Video Pin
Dave Kreskowiak8-Aug-05 6:49
mveDave Kreskowiak8-Aug-05 6:49 
QuestionC# and old "C" Dlls Pin
Mike Doner8-Aug-05 5:59
Mike Doner8-Aug-05 5:59 
GeneralRe: C# and old "C" Dlls Pin
LobsterDK8-Aug-05 9:17
LobsterDK8-Aug-05 9:17 
GeneralChange ScrollBar Color for ListView Pin
blueguitar18-Aug-05 5:54
blueguitar18-Aug-05 5:54 
GeneralRe: Change ScrollBar Color for ListView Pin
Guffa8-Aug-05 7:18
Guffa8-Aug-05 7:18 
GeneralRe: Change ScrollBar Color for ListView Pin
Alomgir Miah8-Aug-05 8:01
Alomgir Miah8-Aug-05 8:01 
QuestionHow to create a Bitmap from a DataGrid Pin
Rick Beideman8-Aug-05 5:40
Rick Beideman8-Aug-05 5:40 
GeneralProblems with Designer executing property's code Pin
Stephen Caldwell8-Aug-05 3:45
Stephen Caldwell8-Aug-05 3:45 
GeneralRe: Problems with Designer executing property's code Pin
leppie8-Aug-05 4:08
leppie8-Aug-05 4:08 
GeneralWebService problem Pin
Dario Solera8-Aug-05 3:41
Dario Solera8-Aug-05 3:41 
GeneralRe: WebService problem Pin
leppie8-Aug-05 4:12
leppie8-Aug-05 4:12 
GeneralRe: WebService problem Pin
Dario Solera8-Aug-05 4:15
Dario Solera8-Aug-05 4:15 

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.