|
1 | | -/* Copyright (c) 2010-2011 Dmitry Vyukov. All rights reserved. |
2 | | - * Redistribution and use in source and binary forms, with or without |
3 | | - * modification, are permitted provided that the following conditions are met: |
4 | | - * |
5 | | - * 1. Redistributions of source code must retain the above copyright notice, |
6 | | - * this list of conditions and the following disclaimer. |
7 | | - * |
8 | | - * 2. Redistributions in binary form must reproduce the above copyright |
9 | | - * notice, this list of conditions and the following disclaimer in the |
10 | | - * documentation and/or other materials provided with the distribution. |
11 | | - * |
12 | | - * THIS SOFTWARE IS PROVIDED BY DMITRY VYUKOV "AS IS" AND ANY EXPRESS OR IMPLIED |
13 | | - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
14 | | - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
15 | | - * SHALL DMITRY VYUKOV OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
16 | | - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
17 | | - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
18 | | - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
19 | | - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
20 | | - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
21 | | - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
22 | | - * |
23 | | - * The views and conclusions contained in the software and documentation are |
24 | | - * those of the authors and should not be interpreted as representing official |
25 | | - * policies, either expressed or implied, of Dmitry Vyukov. |
26 | | - */ |
27 | | - |
28 | | -// http://www.1024cores.net/home/lock-free-algorithms/queues/unbounded-spsc-queue |
| 1 | +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT |
| 2 | +// file at the top-level directory of this distribution and at |
| 3 | +// http://rust-lang.org/COPYRIGHT. |
| 4 | +// |
| 5 | +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | +// option. This file may not be copied, modified, or distributed |
| 9 | +// except according to those terms. |
29 | 10 |
|
30 | 11 | //! A single-producer single-consumer concurrent queue |
31 | 12 | //! |
32 | 13 | //! This module contains the implementation of an SPSC queue which can be used |
33 | 14 | //! concurrently between two threads. This data structure is safe to use and |
34 | 15 | //! enforces the semantics that there is one pusher and one popper. |
35 | 16 |
|
| 17 | +// http://www.1024cores.net/home/lock-free-algorithms/queues/unbounded-spsc-queue |
| 18 | + |
36 | 19 | use alloc::boxed::Box; |
37 | 20 | use core::ptr; |
38 | 21 | use core::cell::UnsafeCell; |
|
0 commit comments