Nmap Development mailing list archives

Re: Locking a mutex by name?


From: "Patrick Donnelly" <batrick.donnelly () gmail com>
Date: Fri, 14 Nov 2008 11:29:34 -0700

On Fri, Nov 14, 2008 at 8:12 AM, Ron <ron () skullsecurity net> wrote:
Patrick Donnelly wrote:

Hi Ron,

On Thu, Nov 13, 2008 at 8:17 PM, Ron <ron () skullsecurity net> wrote:

What you are doing is the expected use. Storing the mutexes in the
registry should not be necessary.


Unless I'm doing something wrong, it isn't working like that. I currently
have this code for testing:

local function get_mutex(state)
 return nmap.mutex("RONTEST")
end

If I use that function in two different places, I seem to get different
results (judging by the error, "Do not have a lock on this mutex"). I've put
debug statements all over, and I don't think I'm doing anything weird.

It sounds like you are unlocking the mutex from a thread that does not
have the lock.

I tried storing it in the registry instead, and that seemed to work. I'm
storing the mutex itself, not the string.

I'm wondering whether this is an artifact of how Lua handles strings, or if
there's a bug in the Mutex code? I can do more testing, if anybody wants,
but it seems to be working now (albeit a little roundabout).

Could you post either your code or a minimal example demonstrating this problem?

Thanks,

-- 
-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant

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


Current thread: