[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

Mutex objects use on Window Objects

Hello All,

This is sample code snippet in my code.

mutex.Lock();
 CString str=list.GetItemText(1,i);
mutex.Unlock();

Now my question is will mutex locks the total list control or only the item I have selected??

Thanks
Sudhakar
0
sudhakar_koundinya
Asked:
sudhakar_koundinya
  • 2
1 Solution
 
SteHCommented:
The mutex will only assure that no other thread/ process can get that mutex. To completly lock the list you need to enclose all access to this ctrl with that mutex.
0
 
SteHCommented:
What is your need? I guess it is not blocking the OS from accessing the list control. Else you need to derive a class from that control and secure all modifier functions with a lock/unloch pair.
0
 
sudhakar_koundinyaAuthor Commented:
OK,
I Just get the doubt
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now