<commit_before>.\" $Id$
.TH PAPI_thread_id 3 "September, 2004" "PAPI Programmer's Reference" "PAPI"

.SH NAME
PAPI_thread_id \- get the thread identifier of the current thread

.SH SYNOPSIS
.B C Interface
.nf
.B #include <papi.h>
.BI "unsigned long PAPI_thread_id(void);"
.fi
.B Fortran Interface
.nf
.B #include "fpapi.h"
.BI PAPIF_thread_id(C_INT\ id )
.fi

.SH DESCRIPTION
This function returns a valid thread identifier. It calls the function
registered with PAPI through a call to 
.B PAPI_thread_init().

.SH ARGUMENTS
None.

.SH RETURN VALUES
Return values are identical to the function registered with PAPI 
through a call to 
.B PAPI_thread_init().

.SH ERRORS
None.

.SH EXAMPLE
.nf
.if t .ft CW
unsigned long tid;

if (PAPI_library_init(PAPI_VER_CURRENT) != PAPI_VER_CURRENT)
  exit(1);

if (PAPI_thread_init(pthread_self) != PAPI_OK)
  exit(1);

if ((tid = PAPI_thread_id()) == (unsigned long int)-1)
  exit(1);

printf("Initial thread id is: %lu\en",tid);
.if t .ft P
.fi

.SH BUGS
This function has no known bugs.

.SH SEE ALSO
.BR PAPI_thread_init "(3) " <commit_msg>Man Page update<commit_after>.\" $Id$
.TH PAPI_thread_id 3 "September, 2004" "PAPI Programmer's Reference" "PAPI"

.SH NAME
PAPI_thread_id \- get the thread identifier of the current thread

.SH SYNOPSIS
.B C Interface
.nf
.B #include <papi.h>
.BI "unsigned long PAPI_thread_id(void);"
.fi
.B Fortran Interface
.nf
.B #include "fpapi.h"
.BI PAPIF_thread_id(C_INT\ id )
.fi

.SH DESCRIPTION
This function returns a valid thread identifier. It calls the function
registered with PAPI through a call to 
.B PAPI_thread_init().

.SH ARGUMENTS
None.

.SH RETURN VALUES
On success, this function returns
.B PAPI_OK.
 On error, a negative error value is returned.

.SH ERRORS
.TP
.B "PAPI_EMISC" 
is returned if there are no threads registered.
.TP
.B "-1"
is returned if the thread id function returns an error.

.SH EXAMPLE
.nf
.if t .ft CW
unsigned long tid;

if ((tid = PAPI_thread_id()) == (unsigned long int)-1)
  exit(1);

printf("Initial thread id is: %lu\en",tid);
.if t .ft P
.fi

.SH BUGS
This function has no known bugs.

.SH SEE ALSO
.BR PAPI_thread_init "(3) " 
{'fraction_non_alphanumeric': 0.10837209302325582, 'fraction_numerical': 0.008837209302325582, 'mean_word_length': 3.8013392857142856, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '631112', 'n_tokens_mistral': 840, 'n_tokens_neox': 800, 'n_words': 302}