Nmap Development mailing list archives

Re: Locking a mutex by name?


From: Ron <ron () skullsecurity net>
Date: Fri, 14 Nov 2008 19:07:15 -0600

Patrick Donnelly wrote:
On Fri, Nov 14, 2008 at 5:04 PM, Ron <ron () skullsecurity net> wrote:

The problem you are experiencing is the mutex is being garbage
collected during the time between you lock it and release it. The
mutexes are stored internally with weak references to allow them to be
collected when no longer used. The registry is holding onto that
reference for you. It is normally expected you use a local reference
to the mutex. I would recommend you not store the reference in the
registry and instead keep it local or in the function's (that is, your
script) environment.

Ah, that would explain the behaviour.

The issue is that multiple scripts need to use the same mutex. If there
are three scripts using SMB against a single host, they need to run
individually. Due to a "feature" in Windows, you can't make more than
one SMB connection at the same time from the same IP.

Do you think that storing them in the registry is a good bet, or do you
see a better way of doing mutexes on a global level?

Ron

-- 
Ron Bowes
http://www.skullsecurity.org/

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: