lxc / go-lxc

Go bindings for liblxc
https://linuxcontainers.org/lxc
Other
431 stars 76 forks source link

Fix the locking logic (v2) #91

Closed caglar10ur closed 7 years ago

caglar10ur commented 7 years ago

The original code where we were doing following

func X()  {
    call makesure
    makesure locks
    ...work
    makesure unlocks
    lock
    ...work
    unlock
}

was potentially racy as someone else could obtain the lock in between makesure and mutex.Lock call.

Changes since last attempt:

==> Test result: success ...

stgraber commented 7 years ago

cool, will take a look.

stgraber commented 7 years ago

Looks good to me, merging and throwing a re-try of all LXD tests just in case.