A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2000-August/008487.html below:

typedef ??? pthread_t and hacky return statements

[Python-Dev] pthreads question: typedef ??? pthread_t and hacky return statements [Python-Dev] pthreads question: typedef ??? pthread_t and hacky return statementsFredrik Lundh fredrik@pythonware.com
Fri, 18 Aug 2000 12:42:54 +0200
trent mick wrote:
>     return (long) *(long *) &threadid;

from what I can tell, pthread_t is a pointer under OSF/1.

I've been using OSF/1 since the early days, and as far as I can
remember, you've never needed to use stupid hacks like that
to convert a pointer to a long integer. an ordinary (long) cast
should be sufficient.

> Could this be changed to
>   return threadid;
> safely?

safely, yes.  but since it isn't a long on all platforms, you might
get warnings from the compiler (see Mark's mail).

:::

from what I can tell, it's compatible with a long on all sane plat-
forms (Win64 doesn't support pthreads anyway ;-), so I guess the
right thing here is to remove volatile and simply use:

    return (long) threadid;

(Mark: can you try this out on your box?  setting up a Python 2.0
environment on our alphas would take more time than I can spare
right now...)

</F>




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4