Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
| ... | ... |
@@ -23,8 +23,8 @@ func NewOutput() *Output {
|
| 23 | 23 |
|
| 24 | 24 |
// Return true if something was written on this output |
| 25 | 25 |
func (o *Output) Used() bool {
|
| 26 |
- o.Mutex.Lock() |
|
| 27 |
- defer o.Mutex.Unlock() |
|
| 26 |
+ o.Lock() |
|
| 27 |
+ defer o.Unlock() |
|
| 28 | 28 |
return o.used |
| 29 | 29 |
} |
| 30 | 30 |
|
| ... | ... |
@@ -32,8 +32,8 @@ func (o *Output) Used() bool {
|
| 32 | 32 |
// to the output will be written to the new destination in addition to all the others. |
| 33 | 33 |
// This method is thread-safe. |
| 34 | 34 |
func (o *Output) Add(dst io.Writer) {
|
| 35 |
- o.Mutex.Lock() |
|
| 36 |
- defer o.Mutex.Unlock() |
|
| 35 |
+ o.Lock() |
|
| 36 |
+ defer o.Unlock() |
|
| 37 | 37 |
o.dests = append(o.dests, dst) |
| 38 | 38 |
} |
| 39 | 39 |
|
| ... | ... |
@@ -42,8 +42,8 @@ func (o *Output) Add(dst io.Writer) {
|
| 42 | 42 |
// destination in addition to all the others. This method is thread-safe. |
| 43 | 43 |
func (o *Output) Set(dst io.Writer) {
|
| 44 | 44 |
o.Close() |
| 45 |
- o.Mutex.Lock() |
|
| 46 |
- defer o.Mutex.Unlock() |
|
| 45 |
+ o.Lock() |
|
| 46 |
+ defer o.Unlock() |
|
| 47 | 47 |
o.dests = []io.Writer{dst}
|
| 48 | 48 |
} |
| 49 | 49 |
|
| ... | ... |
@@ -96,8 +96,8 @@ func (o *Output) AddString(dst *string) error {
|
| 96 | 96 |
// Write writes the same data to all registered destinations. |
| 97 | 97 |
// This method is thread-safe. |
| 98 | 98 |
func (o *Output) Write(p []byte) (n int, err error) {
|
| 99 |
- o.Mutex.Lock() |
|
| 100 |
- defer o.Mutex.Unlock() |
|
| 99 |
+ o.Lock() |
|
| 100 |
+ defer o.Unlock() |
|
| 101 | 101 |
o.used = true |
| 102 | 102 |
var firstErr error |
| 103 | 103 |
for _, dst := range o.dests {
|
| ... | ... |
@@ -113,8 +113,8 @@ func (o *Output) Write(p []byte) (n int, err error) {
|
| 113 | 113 |
// AddTail and AddString tasks to complete. |
| 114 | 114 |
// The Close method of each destination is called if it exists. |
| 115 | 115 |
func (o *Output) Close() error {
|
| 116 |
- o.Mutex.Lock() |
|
| 117 |
- defer o.Mutex.Unlock() |
|
| 116 |
+ o.Lock() |
|
| 117 |
+ defer o.Unlock() |
|
| 118 | 118 |
var firstErr error |
| 119 | 119 |
for _, dst := range o.dests {
|
| 120 | 120 |
if closer, ok := dst.(io.WriteCloser); ok {
|