From owner-freebsd-threads@FreeBSD.ORG Thu Jan 27 22:33:58 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBBAB16A4CE for ; Thu, 27 Jan 2005 22:33:58 +0000 (GMT) Received: from hadar.amcc.com (hadar.amcc.com [192.195.69.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 993F043D2D for ; Thu, 27 Jan 2005 22:33:58 +0000 (GMT) (envelope-from mmontaseri@amcc.com) Received: from [10.66.12.100] (medi.amcc.com [10.66.12.100]) by hadar.amcc.com (Netscape Messaging Server 4.15) with ESMTP id IAZYOQ03.HWA for ; Thu, 27 Jan 2005 14:34:02 -0800 Message-ID: <41F96C25.9070906@amcc.com> Date: Thu, 27 Jan 2005 14:33:09 -0800 From: "Medi Montaseri" User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-threads@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: pthread_t in 5.3 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2005 22:33:59 -0000 I am confused about the pthread_t type in FreeBSD 5.3, can you help.. Based on /usr/include/pthread.h, typedef struct pthread *pthread_t; and when I look for the declaration of "struct pthread" , all I find is a forward declaration with a comment that says, /* * Forward structure definitions. * * These are mostly opaque to the user. */ struct pthread; That is 'struct pthread' is an opaque type.... Then in my application, when I try to find my thread_id, I say cout << "my tid is " << pthread_self() << endl; and I get a hex value. Which is syntactically correct, but semantically in-correct. I'm not interested in the pointer, I'm interested in the numerical thread ID... Now at this point, you'll think all you have to do is to de-reference the pointer. But since 'struct pthrad' is opaque, gdb and myself are clueless to proceed from here. Can someone shed some light on this please... Thanks