Project

General

Profile

Actions

Bug #9884

closed

thread_pthread.c assumes pthread_t is a scalar type

Added by ReiOdaira (Rei Odaira) almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-05-30 trunk 46238) [x86_64-linux]
[ruby-core:62857]

Description

Many code lines in thread_pthread.c assume pthread_t is a scalar type. For example,

    thread_debug("ubf_select_each (%p)\n", (void *)th->thread_id);

and

    if (!timer_thread_id) {

I don't think the standard guarantees pthread_t is a scalar type. z/OS defines pthread_t as a struct, and there seem to be other such environments.
https://sourceware.org/pthreads-win32/faq.html

I understand it could be too cumbersome to rewrite the source, assuming pthread_t might not be a scalar, and actually I am not sure what would be the best way to rewrite it, but I appreciate it if you guys could think of it for the maximum portability. If needed, I am willing to list the source lines to be rewritten.


Files

opaque_thread_id.patch (7.63 KB) opaque_thread_id.patch ReiOdaira (Rei Odaira), 05/30/2014 10:25 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0