• 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: Custom data formatter for pthread_mutex_t?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom data formatter for pthread_mutex_t?


  • Subject: Re: Custom data formatter for pthread_mutex_t?
  • From: Cem Karan <email@hidden>
  • Date: Wed, 15 Aug 2007 10:05:01 -0400

On Tue, 14 Aug 2007 22:47:13 +0100, Peter Mulholland wrote:

I'm debugging some multi-threaded code that I've written, and
suddenly realized that it would be very handy to be able to see the
state of my locks in the debugger.  However, I have no idea how to do
this within XCode.  pthread_mutex_trylock() will potentially affect
how my program runs (although, in truth, running everything under a
debugger is going to affect how it runs anyways) but I want to see if
anyone else has any good ideas.

pthread_mutex_t is an opaque handle on any system that has pthreads. it's contents is always unknown.

What you're suggesting would be useful though... in a function would
be even more useful.. like pthread_mutex_state().

On Tue, 14 Aug 2007 15:05:16 -0700, Dave Camp wrote:

I'm debugging some multi-threaded code that I've written, and
suddenly realized that it would be very handy to be able to see the
state of my locks in the debugger. However, I have no idea how to do
this within XCode. pthread_mutex_trylock() will potentially affect
how my program runs (although, in truth, running everything under a
debugger is going to affect how it runs anyways) but I want to see if
anyone else has any good ideas.

pthread_mutex_t is an opaque handle on any system that has pthreads. it's contents is always unknown.

What you're suggesting would be useful though... in a function would
be even more useful.. like pthread_mutex_state().

Theoretically, you could grab the source from darwin to get the opaque data format and make a debugger formatter statement based on that.

Thank you both. Peter, I agree with you that as a function, this would be extremely useful. In a way, I'm kind of surprised that the POSIX spec doesn't have it. Dave, you're right that I can probably download the source and write up my own pthread_mutex_state(). I managed to get past that part of my code already though, and right now don't have time to look into it. If I do get time in the future though, I think I'll see if I can contribute it to the Darwin project; I suspect I'm not the only one that could use such a function.


Thanks,
Cem Karan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Custom data formatter for pthread_mutex_t?
      • From: Dave Camp <email@hidden>
    • Re: Custom data formatter for pthread_mutex_t?
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: X-Code project Settings
  • Next by Date: Re: X-Code project Settings
  • Previous by thread: Re: Custom data formatter for pthread_mutex_t?
  • Next by thread: Re: Custom data formatter for pthread_mutex_t?
  • Index(es):
    • Date
    • Thread