Click here to Skip to main content
15,911,142 members
Home / Discussions / C#
   

C#

 
GeneralRe: Mutex Not Working Pin
jan larsen9-Aug-05 1:40
jan larsen9-Aug-05 1:40 
GeneralRe: Mutex Not Working Pin
Dwayner799-Aug-05 1:53
Dwayner799-Aug-05 1:53 
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 
From MSDN:

"While a mutual-exclusion lock is held, code executing in the same execution thread can also obtain and release the lock. However, code executing in other threads is blocked from obtaining the lock until the lock is released."

This makes it sound like this will only work in multiple threads. A for loop is one thread... is it not.

Also,

There are two functions being called. Both have to work off the same lock. I tried it with one and it works. I apologize for the confussion. Fromt he original post, I need both functions to work off the same lock. This is what is not working. I can poll the one function (just did 100 times in a row) and it worked fine. when I poll two functions it fails.:

for(int i =1; i < 5; i++)
{
lockedFunction1()
lockedFunction2()
}

What is happening then is this output:

Function1 entered
Function1 exited
Function2 entered
Function1 entered
Function1 exited
Function2 exited (but with an error because value are not right because of mixup.








*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
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 
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 &quot;C&quot; Dlls Pin
Mike Doner8-Aug-05 5:59
Mike Doner8-Aug-05 5:59 
GeneralRe: C# and old &quot;C&quot; 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 

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.