Bruce Momjian wrote:

I have looked over this patch.  I noticed this:
        -static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
        +        static pthread_mutex_t init_mutex;
        +        static int mutex_initialized = 0;
        +        if (!mutex_initialized)
        +        {
        +                mutex_initialized = 1;
        +                pthread_mutex_init(&init_mutex, NULL);
        +        }

While this might work using your pthread compatibility implementation
using CreateMutex(), it will not work on a native pthread implementation
because you can only call pthread_mutex_init() once. Your code allows
two threads to both call it.

I don't really think so. That mutex_initialized is a globally static variable, not a thread local one. Thread interruption between testing mutex_initialized and setting it is very unlikely and still wouldn't do much harm if it actually does happen.

Also, do you not have the problem with SIGPIPE from send(), so you don't
need set/get_thread_specific()?

There's no SIGPIPE under win32, thus no problem.


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to