bug: prevent interleaving websocket ID load/store operations (#217)
This commit is contained in:
parent
e7fa806f78
commit
79e806f6e9
|
@ -112,8 +112,7 @@ impl JsonRpcClient for Ws {
|
|||
method: &str,
|
||||
params: T,
|
||||
) -> Result<R, ClientError> {
|
||||
let next_id = self.id.load(Ordering::SeqCst) + 1;
|
||||
self.id.store(next_id, Ordering::SeqCst);
|
||||
let next_id = self.id.fetch_add(1, Ordering::SeqCst);
|
||||
|
||||
// send the message
|
||||
let (sender, receiver) = oneshot::channel();
|
||||
|
|
Loading…
Reference in New Issue