mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +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)
|
||||
}
|
||||
|
||||
func (m *SyncOrderMap) Orders() OrderSlice {
|
||||
func (m *SyncOrderMap) Orders() (slice OrderSlice) {
|
||||
m.RLock()
|
||||
defer m.RUnlock()
|
||||
return m.orders.Orders()
|
||||
slice = m.orders.Orders()
|
||||
m.RUnlock()
|
||||
return slice
|
||||
}
|
||||
|
||||
type OrderSlice []Order
|
||||
|
|
Loading…
Reference in New Issue
Block a user