Re: [evolution-patches] e-d-s: pthread_t opaqueness patch



Umm, this is really broken.  It's a threading function, and it isn't
thread-safe or reentrant.  It should use a feature test not a platform
test too.

On Wed, 2005-08-17 at 14:32 +0300, Tor Lillqvist wrote:
> +const char *
> +e_pthread_id(pthread_t t)
> +{
> +       static char buffer[100];
> +       char *p = buffer;
> +
> +#ifdef __linux
> +       /* We know that pthread_t is an unsigned long */
> +       sprintf(p, "%lu", t);
> +#else
> +       /* Just print out the contents of the pthred_t */
> +       {
> +               guchar *const tend = (guchar *) ((&t)+1);
> +               guchar *tp = (guchar *) &t;
> +               while (tp < tend) {
> +                       p += sprintf (p, "%02x", *tp);
> +                       tp++;
> +                       if (tp < tend)
> +                               *p++ = ':';
> +               }
> +       }
> +#endif
> +       return buffer;
> +}

What has this got to do with pthread_id?
-                       sleep(1);
+                       g_usleep(1000000);

I must say, the e-msgport changes are a tad bigger than 'only a few
lines'.  Thats why i said to use a new file to implement it.  But since
you didn't, i'm going to hard-insist that you get the style right.  e.g.
no space before ( for function calls.

Also, don't add a has_owner to the object-bag stuff.  It is only used
for assert tests where equality & memset to 0 will do too.

-- 
adfa(evolution-2.4:20087): gtkhtml-WARNING **: cannot find icon:
'stock_insert-url' in gnome 




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