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

C / C++ / MFC

 
GeneralCritical Sections (Semaphores etc..) Pin
Sameer Maggon6-May-02 20:04
Sameer Maggon6-May-02 20:04 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Joaquín M López Muñoz6-May-02 21:03
Joaquín M López Muñoz6-May-02 21:03 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Sameer Maggon6-May-02 21:12
Sameer Maggon6-May-02 21:12 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Joaquín M López Muñoz6-May-02 21:15
Joaquín M López Muñoz6-May-02 21:15 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Sameer Maggon6-May-02 21:30
Sameer Maggon6-May-02 21:30 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Sameer Maggon6-May-02 21:36
Sameer Maggon6-May-02 21:36 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Joaquín M López Muñoz6-May-02 22:20
Joaquín M López Muñoz6-May-02 22:20 
GeneralRe: Critical Sections (Semaphores etc..) Pin
Jonathan Craig7-May-02 7:29
Jonathan Craig7-May-02 7:29 
If you want the class to be thread safe the critical section object should be a member of the class.

class CMySafeClass
{
...
   CCriticalSection m_csObj;
...
}
For methods that must be thread safe do this:
void CMySafeClass::Method1()
{
    m_csObj.Lock();
 
   //Do some work...
 
   m_csObj.Unlock(); 
}
Hope this helps... Smile | :)

Jonathan Craig
www.mcw-tech.com
GeneralGetOverlapedresult Pin
meirav6-May-02 19:24
meirav6-May-02 19:24 
GeneralDetermining Data Size For Network Send/Rec :: Winsock Pin
valikac6-May-02 18:55
valikac6-May-02 18:55 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
Niklas L6-May-02 21:24
Niklas L6-May-02 21:24 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
valikac6-May-02 21:38
valikac6-May-02 21:38 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
Rickard Andersson206-May-02 21:45
Rickard Andersson206-May-02 21:45 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
6-May-02 21:56
suss6-May-02 21:56 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
Rickard Andersson206-May-02 23:48
Rickard Andersson206-May-02 23:48 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
6-May-02 23:58
suss6-May-02 23:58 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
valikac7-May-02 4:49
valikac7-May-02 4:49 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
valikac7-May-02 4:45
valikac7-May-02 4:45 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
Niklas L6-May-02 22:10
Niklas L6-May-02 22:10 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
valikac7-May-02 4:39
valikac7-May-02 4:39 
GeneralRe: Determining Data Size For Network Send/Rec :: Winsock Pin
7-May-02 19:55
suss7-May-02 19:55 
GeneralEnable/Disable A Window in SplitView :: MFC Pin
valikac6-May-02 18:32
valikac6-May-02 18:32 
GeneralCString! Pin
tongc6-May-02 17:21
tongc6-May-02 17:21 
GeneralRe: CString! Pin
Bugra Barin6-May-02 17:32
Bugra Barin6-May-02 17:32 
GeneralRe: CString! Pin
tongc6-May-02 23:24
tongc6-May-02 23:24 

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.