Le Sunday 11 January 2009 18:07:23 Dan Langille, vous avez écrit :
> Eric Bollengier wrote:
> > Le Saturday 10 January 2009 01:02:10 Dan Langille, vous avez écrit :
> >> Eric Bollengier wrote:
> >>> Hello Dan,
> >>>
> >>> The "pthread" type is not defined on linux... (i have a pthread_t
> >>> instead) And on linux, pthread_t is an integer, which seems to
> >>> different on freebsd.
> >>>
> >>> Maybe i can use a void * cast at this place ?
> >
> > I have take a look to freebsd7 man pages, and they use pthread_t object
> > too.
>
> What cast do you want me to try?  The following compiles cleanly:
>
> -              jcr->use_count(), (int)jcr->my_thread_id);
> +              jcr->use_count(), (pthread *)jcr->my_thread_id);

I think that the you can test (void *) and change 0x%x to %p 

> >> or an #ifdef based on the OS?
> >
> > At this place, i would like to display the same thing than in gdb
> > backtrace.
>
> I suspect pthread_t on Linux differs from pthread_t on FreeBSD.

Possible, but not a good idea.... I think that int is too small to handle a 
pthread_t. (uint64_t or void* should be ok)

Bye

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to