context_sync.go 328 B

12345678910111213141516171819202122
  1. package honeybadger
  2. import "sync"
  3. type contextSync struct {
  4. sync.RWMutex
  5. internal Context
  6. }
  7. func (context *contextSync) Update(other Context) {
  8. context.Lock()
  9. context.internal.Update(other)
  10. context.Unlock()
  11. }
  12. func newContextSync() *contextSync {
  13. instance := contextSync{
  14. internal: Context{},
  15. }
  16. return &instance
  17. }