mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +00:00
improve order slice lock
This commit is contained in:
parent
ed6d6342e7
commit
18d9245b06
|
@ -159,10 +159,11 @@ func (m *SyncOrderMap) Canceled() OrderSlice {
|
||||||
return m.FindByStatus(OrderStatusCanceled)
|
return m.FindByStatus(OrderStatusCanceled)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SyncOrderMap) Orders() OrderSlice {
|
func (m *SyncOrderMap) Orders() (slice OrderSlice) {
|
||||||
m.RLock()
|
m.RLock()
|
||||||
defer m.RUnlock()
|
slice = m.orders.Orders()
|
||||||
return m.orders.Orders()
|
m.RUnlock()
|
||||||
|
return slice
|
||||||
}
|
}
|
||||||
|
|
||||||
type OrderSlice []Order
|
type OrderSlice []Order
|
||||||
|
|
Loading…
Reference in New Issue
Block a user