Skip to content

Commit

Permalink
A bit cleanup of NEXT_NAMESPACE_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
sotaroikeda committed Sep 26, 2018
1 parent 43e8d85 commit 6e85020
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions webrender/src/render_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use serde::{Serialize, Deserialize};
use serde_json;
#[cfg(any(feature = "capture", feature = "replay"))]
use std::path::PathBuf;
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::mem::replace;
use std::os::raw::c_void;
use std::sync::mpsc::{channel, Sender, Receiver};
Expand Down Expand Up @@ -360,7 +360,8 @@ impl DocumentOps {
}

/// The unique id for WR resource identification.
static NEXT_NAMESPACE_ID: AtomicUsize = ATOMIC_USIZE_INIT;
/// The namespace_id should start from 1.
static NEXT_NAMESPACE_ID: AtomicUsize = AtomicUsize::new(1);

#[cfg(any(feature = "capture", feature = "replay"))]
#[cfg_attr(feature = "capture", derive(Serialize))]
Expand Down Expand Up @@ -419,9 +420,6 @@ impl RenderBackend {
sampler: Option<Box<AsyncPropertySampler + Send>>,
size_of_op: Option<VoidPtrToSizeFn>,
) -> RenderBackend {
// The namespace_id should start from 1.
NEXT_NAMESPACE_ID.fetch_add(1, Ordering::Relaxed);

RenderBackend {
api_rx,
payload_rx,
Expand Down

0 comments on commit 6e85020

Please sign in to comment.