C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old May 8th, 2008, 03:02 PM
AndyMNE's Avatar
AndyMNE AndyMNE is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Location: Iowa
Posts: 187 AndyMNE User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndyMNE User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndyMNE User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndyMNE User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndyMNE User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndyMNE User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndyMNE User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 1 h 50 m 10 sec
Reputation Power: 74
MySpace
CSingleLock issue

C++ & MFC

I'm having an issue where if one thread locks a CMutex object using a CSingleLock and then another thread uses a CSingleLock to lock the same CMutex object, everything freezes up.

From what I've read of CSingleLock documentation, if a CSingleLock attempts to lock a CMutex that has already been locked, it will wait for it to be signaled (unlocked) and then lock it and let the code go about it's business.

Here, when the second lock goes to lock the already locked CMutex object, it just freezes up the application completely...
__________________
www.myspace.com/andylowwww
Soft Dev - C++/SQL/MFC

Last edited by AndyMNE : May 8th, 2008 at 03:13 PM.

Reply With Quote
  #2  
Old May 8th, 2008, 04:21 PM
f'lar's Avatar
f'lar f'lar is offline
Senior WeyrLeader
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Aug 2003
Location: WI
Posts: 3,782 f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level)f'lar User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 3 Days 22 h 12 m 27 sec
Reputation Power: 675
Send a message via Google Talk to f'lar
It freezes because it's waiting for your other thread to release the mutex. The other thread is likely waiting for something this thread does. Deadlock.
__________________
Primary Forums: .Net Development, MS-SQL, C Programming
VB.Net: It's not your father's Visual Basic.

[Moving to ASP.Net] | [.Net Dos and Don't for VB6 Programmers]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > CSingleLock issue


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway