Re: BUG: pgScript NOT thread safe!!

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Mickael Deloison <mdeloison(at)gmail(dot)com>, Andras Fabian <Fabian(at)atrada(dot)net>, pgadmin-support(at)postgresql(dot)org
Subject: Re: BUG: pgScript NOT thread safe!!
Date: 2009-06-26 08:11:18
Message-ID: 937d27e10906260111w43c18824u86a36bf2ed116948@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Fri, Jun 26, 2009 at 5:50 AM, Ashesh
Vashi<ashesh(dot)vashi(at)enterprisedb(dot)com> wrote:

> That's really weird.
> I tried that patch on windows and found that - the behavior of wxMutex is
> not as expected. :(
>
> On Gtk (Ubuntu 9.04 32bit), the message-box does not adjust to the length of
> the title message.
> (Please find the attached screen-shot.)
>
> Please find the updated patch, it is working on gtk & windows both.
> Though it has not been tested on Osx, but I think - it should work.

Per IM discussion, I've removed the mutex altogether. This code all
gets called in the primary UI thread, so there's actually no
concurrency issue until the script actually starts, thus we can
protect it with a simple static bool.

I suspect this is why the mutex didn't behave as expected - it's
intended to keep different threads out of the protected area.

Tests OK on OSX.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Attachment Content-Type Size
AvoidRunningMultipleScripts_v5.patch application/octet-stream 2.1 KB

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2009-06-26 08:17:16 Re: BUG: pgScript NOT thread safe!!
Previous Message Dave Page 2009-06-25 21:08:41 Re: BUG: pgScript NOT thread safe!!