• 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: Where did mach_thread_self() go? (solved)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where did mach_thread_self() go? (solved)


  • Subject: Re: Where did mach_thread_self() go? (solved)
  • From: EJ Campbell <email@hidden>
  • Date: Fri, 30 Aug 2002 17:54:12 -0700

With the help from someone from the Metrowerk's newsgroup, I figured out the problem. The file, "mach_init.h" (and other system headers) aren't properly bracketed with the extern "C" keyword. Therefore, the C++ compiler does not know that the methods defined by them are really C methods.

Before, I got around this problem by placing an extern "C" block around the inclusion of "mach_init.h" in my prefix file. However, I was doing the "mach_init.h" inclusion after including "Carbon/Carbon.h". This worked fine in Mac OS X 10.1 because "Carbon/Carbon.h" did not include "mach_init.h". However, with 10.2, things changed, and some file referenced by "Carbon/Carbon.h" must now be including "mach_init.h" from outside an extern "C" block. Because of this, including it again, this time from within the requisite extern "C" block, had no effect.

Anyway, to make a long story short, I fixed the problem by including mach_init.h from within an extern "C" block at the top of my prefix file.

Does anyone know why mach_init.h and some other system headers do not have the standard extern "C" declaration around them like all the other headers have?

Thanks,
EJ

On Wednesday, August 28, 2002, at 12:20 PM, EJ Campbell wrote:

I'm receiving a link error that 'mach_thread_self()' is undefined when linking a Code Warrior 8 project on Mac OS X 10.2 GM. The same code worked and linked fine on Mac OS X 10.1.

Where does 'mach_thread_self()' reside on Jaguar? Has anyone else ran into this problem, and if so, how did you solve it? The reason I need to use the call is that I want to set the priority of an MPTask, and the easiest way to do it is from within the task with a call such as this:
rv = thread_policy_set ( mach_thread_self(),
THREAD_TIME_CONSTRAINT_POLICY,
(thread_policy_t) &constraintPolicy,
THREAD_TIME_CONSTRAINT_POLICY_COUNT );

If mach_thread_self() has some how gone away, does anyone know of another way to retrieve a pointer to an MPTask's underlying mach thread?

Thanks,
EJ
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Where did mach_thread_self() go? (solved)
      • From: Andrew Pinski <email@hidden>
References: 
 >Where did mach_thread_self() go? (From: EJ Campbell <email@hidden>)

  • Prev by Date: Re: Simple HAL device question
  • Next by Date: Re: Where did mach_thread_self() go? (solved)
  • Previous by thread: Where did mach_thread_self() go?
  • Next by thread: Re: Where did mach_thread_self() go? (solved)
  • Index(es):
    • Date
    • Thread