terraform/helper/shadow
James Bardin 657932261b Make sure shadow.closeWalker doesn't copy Mutexes
The Close methods on shadow.Values require pointer receivers because
they contain a sync.Mutex, but that value was being copied through
Value.Interface by the closeWalker.  Because reflectwalk passes the
struct fields to the StructField method as they are defined in the
struct, and they may have been read as a value, we can't immediately
call Interface() to check the method set without possibly copying the
internal mutex values. Use the Implements method to first check if we
need to call Interface, and if it's not, then we can check if the value
is addressable.

Because of this use of reflection, we can't vet for the copying of these
locks. The minimal amount of code in the Close method left us only with
a race detected within the mutex itself, which leads to a stacktrace
pointing to the runtime rather than our code.
2017-07-07 11:20:54 -04:00
..
closer.go Make sure shadow.closeWalker doesn't copy Mutexes 2017-07-07 11:20:54 -04:00
closer_test.go helper/shadow: Close for auto-closing all values 2016-11-15 08:54:26 -08:00
compared_value.go helper/shadow: ComparedValue 2016-10-11 22:17:30 +08:00
compared_value_test.go helper/shadow: ComparedValue 2016-10-11 22:17:30 +08:00
keyed_value.go helper/shadow: keyedValue.WaitForChange must unlock 2016-10-21 17:57:00 -07:00
keyed_value_test.go helper/shadow: keyedValue.WaitForChange must unlock 2016-10-21 17:57:00 -07:00
ordered_value.go
ordered_value_test.go
value.go make shadow.Value a Locker 2017-07-06 16:58:29 -04:00
value_test.go helper/shadow: KeyedValue.Close 2016-10-11 22:17:29 +08:00