Skip to content

Commit

Permalink
restore the TODO about sync.Map
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua MacDonald committed Sep 24, 2021
1 parent 2e183e9 commit 6e984a5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sdk/metric/controller/basic/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ var ErrControllerStarted = fmt.Errorf("controller already started")
// using the export.Reader RWLock interface. Collection will
// be blocked by a pull request in the basic controller.
type Controller struct {
lock sync.Mutex
// lock protects libraries and synchronizes Start() and Stop().
lock sync.Mutex
// TODO: libraries is synchronized by lock, but could be
// accomplished using a sync.Map. The SDK specification will
// probably require this, as the draft already states that
// Stop() and MeterProvider.Meter() should not block each
// other.
libraries map[instrumentation.Library]*registry.UniqueInstrumentMeterImpl
checkpointerFactory export.CheckpointerFactory

Expand Down

0 comments on commit 6e984a5

Please sign in to comment.