Skip to content

Commit

Permalink
Updated thread_id() to make it raise errors instead of returning C er…
Browse files Browse the repository at this point in the history
…ror values
  • Loading branch information
flozz committed Mar 5, 2024
1 parent fee2492 commit 79af10b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pypapi/papi_low.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,17 +1291,16 @@ def strerror(errCode):
# unsigned long PAPI_thread_id(void);
@papi_error
def thread_id():
"""thread_id()
"""Get the thread identifier of the current thread.
Get the thread identifier of the current thread.
:returns: PAPI_EMISC is returned if there are no threads registered.
-1 is returned if the thread id function returns an error.
This function returns a valid thread identifier.
:returns: a valid thread identifier.
:rtype: ctypes.c_ulonglong
:raises PapiMiscellaneousError: if there are no threads registered.
:raises PapiInvalidValueError: if the thread id function returns an error.
"""
rval = lib.PAPI_thread_id()
return c_ulonglong(rval)
return rval, c_ulonglong(rval)


# int PAPI_thread_init(unsigned long (*id_fn) (void));
Expand Down

0 comments on commit 79af10b

Please sign in to comment.