[        SIDE_EFFECT.fetch_add(self.0, 
atomic::Ordering::SeqCst);](https://github.com/apache/incubator-teaclave-sgx-sdk/blob/495b91f6e690a8c7a3b94241ba58eb44cc22739d/sgx_tstd/hashbrown/benches/bench.rs#L56),https://github.com/apache/incubator-teaclave-sgx-sdk/blob/495b91f6e690a8c7a3b94241ba58eb44cc22739d/samplecode/tls/tlsclient/enclave/src/lib.rs#L245,https://github.com/apache/incubator-teaclave-sgx-sdk/blob/495b91f6e690a8c7a3b94241ba58eb44cc22739d/samplecode/tls/tlsserver/enclave/src/lib.rs#L181
I think the use of ordering here is incorrect, AtomicUsize is used here for 
counting, not to synchronize access to other shared variables. Therefore, only 
Relaxed needs to be used here to ensure the correctness of the program.
You can view, comment on, or merge this pull request online at:

  https://github.com/apache/incubator-teaclave-sgx-sdk/pull/424

-- Commit Summary --

  * Modified atomic::ordering

-- File Changes --

    M samplecode/tls/tlsclient/enclave/src/lib.rs (2)
    M samplecode/tls/tlsserver/enclave/src/lib.rs (2)
    M sgx_tstd/hashbrown/benches/bench.rs (2)

-- Patch Links --

https://github.com/apache/incubator-teaclave-sgx-sdk/pull/424.patch
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/424.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/424
You are receiving this because you are subscribed to this thread.

Message ID: <apache/incubator-teaclave-sgx-sdk/pull/[email protected]>

Reply via email to