Click here to Skip to main content
15,902,114 members
Home / Discussions / C#
   

C#

 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
led mike10-Oct-07 4:45
led mike10-Oct-07 4:45 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
Stevo Z10-Oct-07 5:24
Stevo Z10-Oct-07 5:24 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
led mike10-Oct-07 5:58
led mike10-Oct-07 5:58 
AnswerRe: Mutex.ReleaseMutex() asynchronous ? Pin
Stevo Z10-Oct-07 8:36
Stevo Z10-Oct-07 8:36 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
led mike10-Oct-07 8:51
led mike10-Oct-07 8:51 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
Stevo Z10-Oct-07 9:32
Stevo Z10-Oct-07 9:32 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
led mike10-Oct-07 10:13
led mike10-Oct-07 10:13 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
Stevo Z10-Oct-07 10:45
Stevo Z10-Oct-07 10:45 
I disagree

Lets talk in steps :

Assuming:
Mutex is identified by unique name, which only my app knows and uses.
If I dont get Mutex ownership immediately, I don't wait for it (Mutex.WaitOne()), that means I don't have anything to Release.


1. Very first app launch, try to get ownership of Mutex, receives it because Mutex is not owned by any other processes.
2. Do whatever app does.
3. Release Mutex ownership. At this point, there should be no Mutex ownership.
4. Restart app.
5. Starting second app instance. If Mutex was previously released correctly and no other same app's are running (the first one may be still running but Mutex was released), I should receive Mutex ownership same way I received it first time. But for some reason, there is still ownership pending from first Launch sometimes. That's my problem.
6. If has ownership -> Step 2. Else -> Let user know that there cannot be more app instances.
7. If has ownership -> Step 3. Else -> Finishing without releasing ownership (which I don't posses).
8. Restart etc...
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
led mike10-Oct-07 11:03
led mike10-Oct-07 11:03 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
Stevo Z10-Oct-07 11:14
Stevo Z10-Oct-07 11:14 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
led mike10-Oct-07 11:36
led mike10-Oct-07 11:36 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
Stevo Z10-Oct-07 11:44
Stevo Z10-Oct-07 11:44 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
Dave Kreskowiak10-Oct-07 14:05
mveDave Kreskowiak10-Oct-07 14:05 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
Stevo Z10-Oct-07 20:25
Stevo Z10-Oct-07 20:25 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
Stevo Z10-Oct-07 22:01
Stevo Z10-Oct-07 22:01 
GeneralRe: Mutex.ReleaseMutex() asynchronous ? Pin
Dave Kreskowiak11-Oct-07 1:56
mveDave Kreskowiak11-Oct-07 1:56 
QuestionWeb browser control (Print() functionality) - Printing in landscape from code Pin
madhusri9-Oct-07 3:25
madhusri9-Oct-07 3:25 
QuestionSerializing an Interface in C# Pin
Lucian.Palcu9-Oct-07 3:23
Lucian.Palcu9-Oct-07 3:23 
AnswerRe: Serializing an Interface in C# Pin
mav.northwind9-Oct-07 19:31
mav.northwind9-Oct-07 19:31 
GeneralRe: Serializing an Interface in C# Pin
Lucian.Palcu9-Oct-07 21:10
Lucian.Palcu9-Oct-07 21:10 
QuestionRe: Serializing an Interface in C# Pin
TJoe10-Oct-07 5:32
TJoe10-Oct-07 5:32 
AnswerRe: Serializing an Interface in C# Pin
Lucian.Palcu10-Oct-07 5:40
Lucian.Palcu10-Oct-07 5:40 
GeneralRe: Serializing an Interface in C# Pin
TJoe10-Oct-07 5:56
TJoe10-Oct-07 5:56 
AnswerRe: Serializing an Interface in C# Pin
Lucian.Palcu10-Oct-07 6:05
Lucian.Palcu10-Oct-07 6:05 
Questionproblem in "Splash screen demo" tutorial Pin
mandeeep9-Oct-07 3:16
mandeeep9-Oct-07 3:16 

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.