• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to wake up a process by pid?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to wake up a process by pid?


  • Subject: Re: how to wake up a process by pid?
  • From: Terry Lambert <email@hidden>
  • Date: Mon, 1 Oct 2007 16:54:29 -0700

On Sep 29, 2007, at 10:50 AM, Vishal Shetye wrote
Hi all,
I’m facing problem synchronizing threads in my kext.

I have a thread ‘A’ waiting on an event, I’m using assert_wait() and thread_block() for the purpose.
What other thread ‘B’ has is pid of ‘A’.
B should wake A and then A should continue normally.


I tried doing something like, use pfind() or proc_findref() to get proc_t and then use psignal with SIGCONT,
For some reason this doesn’t seem to work.


I’m using x86 intel based mac pro, with osx10.4. is there something I’m missing or is it something specific to intel based macs

You are missing something. Unless you specify THREAD_ABORTSAFE instead of THREAD_UNINT, signals will not get delivered nor will they wake up the thread block.


Also, you should probably not be using signals; if you are going to go to the trouble of using Mach primitives instead of sleep()/msleep() (the BSD layer mechanisms for blocking synchronization), then you should do this by task, not by process.

Alternately, you could use sleep()/msleep() instead, and use signals (be sure you OR PCATCH int pri).

Note that going this route, msleep() is the preferred API; sleep() is in the unsupported symbol set.

-- Terry _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Disk Arbitration timeout
  • Next by Date: volumeIsBootVolume
  • Previous by thread: Re: Disk Arbitration timeout
  • Next by thread: volumeIsBootVolume
  • Index(es):
    • Date
    • Thread