mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to v0.11.0-rc4
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:

committed by
Tonis Tiigi

parent
a8be6b576b
commit
7394853ddf
26
vendor/github.com/moby/buildkit/util/tracing/detect/threadsafe.go
generated
vendored
Normal file
26
vendor/github.com/moby/buildkit/util/tracing/detect/threadsafe.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
package detect
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
)
|
||||
|
||||
// threadSafeExporterWrapper wraps an OpenTelemetry SpanExporter and makes it thread-safe.
|
||||
type threadSafeExporterWrapper struct {
|
||||
mu sync.Mutex
|
||||
exporter sdktrace.SpanExporter
|
||||
}
|
||||
|
||||
func (tse *threadSafeExporterWrapper) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error {
|
||||
tse.mu.Lock()
|
||||
defer tse.mu.Unlock()
|
||||
return tse.exporter.ExportSpans(ctx, spans)
|
||||
}
|
||||
|
||||
func (tse *threadSafeExporterWrapper) Shutdown(ctx context.Context) error {
|
||||
tse.mu.Lock()
|
||||
defer tse.mu.Unlock()
|
||||
return tse.exporter.Shutdown(ctx)
|
||||
}
|
Reference in New Issue
Block a user