Re: [xml] Submitting patches, list or bugzilla?

On Fri, Nov 12, 2010 at 02:18:31PM +0200, Andrew W. Nosenko wrote:
On Fri, Nov 12, 2010 at 10:12, Arnold Hendriks <a hendriks b-lex nl> wrote:
See eg
- a portable application cannot assume pthread_t is castable from/to an
(the first reference I found, but i'm sure it's in the posix specs too - the
issue comes up once in a while on comp.programming.threads)

This is the pthread-win32 definition of pthread_t:

typedef struct {
   void * p;                   /* Pointer to actual object */
   unsigned int x;             /* Extra information - reuse count etc */
} ptw32_handle_t;

typedef ptw32_handle_t pthread_t;

and it's the reason why

tid[i] = (pthread_t) -1;


  Yeah, so far it breaks only on windows 64 bits though, but this need

Setting tid[i] to pthread_self may not be in the right spirit for the tests
I guess, but I don't really know of another way to initialize a threadid.

  It's not really the spirit but IMHO that was good enough, I nearly
  commited that patch,

memset(&tid[i], 0xff, sizeof(tid[i])) ?

May be even replace whole

      for (i = 0; i < num_threads; i++) {
          results[i] = NULL;
          tid[i] = (pthread_t) -1;

        memset(results, 0, sizeof(*results)*num_threads);
        memset(tid, 0xff, sizeof(*tid)*num_threads);

  The only "problem" is that 0xff based pointers may still look like
valid pointers, but that's probably the best option at this point, yes
if this test end up failing for some reason that will still be easy to
sort out.

  So I commited and pushed your patch, thanks Andrew !


Daniel Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]