Click here to Skip to main content
15,918,889 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Windows Message Question Pin
Tom Wright3-Nov-04 10:33
Tom Wright3-Nov-04 10:33 
GeneralRe: Windows Message Question Pin
Joaquín M López Muñoz3-Nov-04 10:53
Joaquín M López Muñoz3-Nov-04 10:53 
GeneralRe: Windows Message Question Pin
Tom Wright3-Nov-04 11:50
Tom Wright3-Nov-04 11:50 
GeneralMemory Allocation error _CrtCheckMemory() Pin
Rassul Yunussov3-Nov-04 6:49
Rassul Yunussov3-Nov-04 6:49 
GeneralMutex problem Pin
anderslundsgard3-Nov-04 5:11
anderslundsgard3-Nov-04 5:11 
GeneralRe: Mutex problem Pin
valikac3-Nov-04 6:12
valikac3-Nov-04 6:12 
GeneralRe: Mutex problem Pin
anderslundsgard3-Nov-04 20:23
anderslundsgard3-Nov-04 20:23 
GeneralRe: Mutex problem Pin
peterchen3-Nov-04 10:16
peterchen3-Nov-04 10:16 
d00_ape wrote:
What have I missed?

the principle how mutexes are intended to work Roll eyes | :rolleyes:

A Mutex protects a resource so that only one thread accesses it at a given time.

A Mutex has two states:
- "Free"
- Acquired by one specific thread

Lock tries to acquire the mutex. It succeeds if
- the Mutex was "Free"
- the Mutex was acquired by the current thread

If it succeeds, the mutex is now acquried by the current thread.

To release the mutex, Unlock must be called:
- in the same thread that called Lock
- the same number of times Lock() was called by this thread

Check the other synchronization objects (I think there was a nice tutorial here on CP) which suit your needs better.


we are here to help each other get through this thing, whatever it is Vonnegut jr.
boost your code || Fold With Us! || sighist | doxygen

GeneralRe: Mutex problem Pin
anderslundsgard3-Nov-04 20:22
anderslundsgard3-Nov-04 20:22 
GeneralRe: Mutex problem Pin
peterchen3-Nov-04 20:49
peterchen3-Nov-04 20:49 
GeneralRe: Mutex problem Pin
anderslundsgard3-Nov-04 21:37
anderslundsgard3-Nov-04 21:37 
GeneralAudio Sample Rate Interpolation Pin
Anthony98873-Nov-04 4:40
Anthony98873-Nov-04 4:40 
GeneralRe: Audio Sample Rate Interpolation Pin
Alexander M.,3-Nov-04 6:07
Alexander M.,3-Nov-04 6:07 
GeneralLiveUpdates app with Visual C++ 6.0 Pin
roxanab3-Nov-04 4:35
roxanab3-Nov-04 4:35 
GeneralRe: LiveUpdates app with Visual C++ 6.0 Pin
Alexander M.,3-Nov-04 6:11
Alexander M.,3-Nov-04 6:11 
GeneralRe: LiveUpdates app with Visual C++ 6.0 Pin
roxanab3-Nov-04 6:18
roxanab3-Nov-04 6:18 
GeneralRe: LiveUpdates app with Visual C++ 6.0 Pin
Ted Ferenc3-Nov-04 6:36
Ted Ferenc3-Nov-04 6:36 
GeneralScanner TWAIN Pin
ivax3-Nov-04 4:05
ivax3-Nov-04 4:05 
GeneralCListCtrl and the common control Pin
hcatech3-Nov-04 3:24
hcatech3-Nov-04 3:24 
GeneralRe: CListCtrl and the common control Pin
Rage3-Nov-04 4:33
professionalRage3-Nov-04 4:33 
GeneralPlaying online .ASX files (streaming radio) Pin
Bail Organa3-Nov-04 3:24
Bail Organa3-Nov-04 3:24 
Generaluse string instead of commands Pin
dSolariuM3-Nov-04 2:35
dSolariuM3-Nov-04 2:35 
GeneralRe: use string instead of commands Pin
Maximilien3-Nov-04 3:08
Maximilien3-Nov-04 3:08 
GeneralRe: use string instead of commands Pin
David Crow3-Nov-04 3:09
David Crow3-Nov-04 3:09 
GeneralRe: use string instead of commands Pin
BlackDice3-Nov-04 4:08
BlackDice3-Nov-04 4:08 

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.