lkml.org 
[lkml]   [2005]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Thread_Id
Arjan van de Ven wrote:

>On Thu, 2005-07-14 at 11:03 +0530, RVK wrote:
>
>
>>Robert Hancock wrote:
>>
>>
>>
>>>RVK wrote:
>>>
>>>
>>>
>>>>Can anyone suggest me how to get the threadId using 2.6.x kernels.
>>>>pthread_self() does not work and returns some -ve integer.
>>>>
>>>>
>>>What do you mean, negative integer? It's not an integer, it's a
>>>pthread_t, you're not even supposed to look at it..
>>>
>>>
>>What is pthread_t inturn defined to ? pthread_self for 2.4.x thread
>>libraries return +ve number(as u have a objection me calling it as
>>integer :-))
>>
>>
>
>it doesn't return a number it returns a pointer ;) or a floating point
>number. You don't know :)
>
>what it returns is a *cookie*. A cookie that you can only use to pass
>back to various pthread functions.
>
>
>
Hahaha......common. Please clarify following....
SYNOPSIS
#include <pthread.h>

pthread_t pthread_self(void);

DESCRIPTION
pthread_self return the thread identifier for the calling thread.

bits/pthreadtypes.h:150:typedef unsigned long int pthread_t;

rvk

>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>.
>
>
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-14 12:16    [W:0.063 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site