How can i make some other thread acquire a lock?

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
mohitdhingras
Posts: 1
Joined: Tue Sep 27, 2011 2:40 pm
Location: India

How can i make some other thread acquire a lock?

Post by mohitdhingras »

I want child thread to acquire a lock as soon as it becomes alive. But at the time of initialization of child thread, running thread is parent thread. At the time of initialization, I want child thread to acquire the lock.. How can I do that?

Is there any other way , by which I can do that?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: How can i make some other thread acquire a lock?

Post by Combuster »

Child requests lock, which causes task switch and gives the parent the opportunity to release it, right?

Otherwise, post the original cause of the problem and why you want to solve it like this.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply