cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nitin Mehta <>
Subject Re: [QUESTION] Synchronizing across management servers
Date Wed, 14 Jan 2015 01:45:40 GMT
Yes, it should do it for you. Please check for the references of this
method and ensure there are other logic pieces using this.
It might help if you can you give some context of of your use case ?


On 13/01/15 4:12 PM, "Mike Tutkowski" <> wrote:

>I have code in my plug-in that I'd like to make sure doesn't run in
>multiple threads at the same time.
>Of course if there were only the possibility of one management server ever
>running at a time, then I could just use synchronized.
>What is the recommended CloudStack approach?
>I see code like this in places (in a try block):
>                GlobalLock lock =
>                if (!lock.lock(5)) {
>                    s_logger.debug("Couldn't lock the db on the string " +
>                    return null;
>                }
>Then the finally block has this:
>Does this achieve what I'm looking for?
>*Mike Tutkowski*
>*Senior CloudStack Developer, SolidFire Inc.*
>o: 303.746.7302
>Advancing the way the world uses the cloud

View raw message