mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
fix ordering issue in refcount increment for trng
want to add to the reference before claiming, so if a drop happens while we're claiming we don't get the connection being destroyed in the race.
This commit is contained in:
parent
239cdef1ef
commit
18abf7ca0a
1 changed files with 1 additions and 1 deletions
|
|
@ -12,10 +12,10 @@ pub struct Trng {
|
||||||
}
|
}
|
||||||
impl Trng {
|
impl Trng {
|
||||||
pub fn new(xns: &xous_names::XousNames) -> Result<Self, xous::Error> {
|
pub fn new(xns: &xous_names::XousNames) -> Result<Self, xous::Error> {
|
||||||
|
REFCOUNT.fetch_add(1, Ordering::Relaxed);
|
||||||
let conn = xns
|
let conn = xns
|
||||||
.request_connection_blocking(api::SERVER_NAME_TRNG)
|
.request_connection_blocking(api::SERVER_NAME_TRNG)
|
||||||
.expect("Can't connect to TRNG server");
|
.expect("Can't connect to TRNG server");
|
||||||
REFCOUNT.fetch_add(1, Ordering::Relaxed);
|
|
||||||
Ok(Trng {
|
Ok(Trng {
|
||||||
conn,
|
conn,
|
||||||
error_sid: None,
|
error_sid: None,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue