qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (Jira)" <j...@apache.org>
Subject [jira] [Commented] (DISPATCH-1694) sys_thread_self() returns NULL pointer if called by main process thread
Date Mon, 29 Jun 2020 13:43:00 GMT

    [ https://issues.apache.org/jira/browse/DISPATCH-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147793#comment-17147793

ASF subversion and git services commented on DISPATCH-1694:

Commit 920df277eb2342df751e256be96224ebd9865878 in qpid-dispatch's branch refs/heads/master
from Ken Giusti
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=920df27 ]

DISPATCH-1694: sys_thread_self() returns non-null for main thread

This closes #768

> sys_thread_self() returns NULL pointer if called by main process thread
> -----------------------------------------------------------------------
>                 Key: DISPATCH-1694
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1694
>             Project: Qpid Dispatch
>          Issue Type: Bug
>          Components: Router Node
>    Affects Versions: 1.13.0
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>            Priority: Major
>             Fix For: 1.13.0
> Since the main process "thread" is not a pthread it does not have a sys_thread_t associated
with it.  Since the router uses the main thread as an I/O thread this means that an I/O thread
can have a null sys_thread_self() value.
> While technically not _wrong_ it is unexpected; it makes comparing the return value of
sys_thread_self() against a null/uninitialized pointer succeed.
> Proposed solution - return a dummy, non-zero value from sys_thread_id() when called from
the main thread.  Ensure this value is unique with respect to sys_thread_id() values returned
by the "real" pthreads.

This message was sent by Atlassian Jira

To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org

View raw message