|
1 | 1 | """
|
2 |
| -A fork of Python 3.6's stdlib queue with Lock swapped out for RLock to avoid a |
3 |
| -deadlock while garbage collecting. |
| 2 | +A fork of Python 3.6's stdlib queue (found in Pythons 'cpython/Lib/queue.py') |
| 3 | +with Lock swapped out for RLock to avoid a deadlock while garbage collecting. |
4 | 4 |
|
5 |
| -See |
| 5 | +https://github.com/python/cpython/blob/v3.6.12/Lib/queue.py |
| 6 | +
|
| 7 | +
|
| 8 | +See also |
6 | 9 | https://codewithoutrules.com/2017/08/16/concurrency-python/
|
7 | 10 | https://bugs.python.org/issue14976
|
8 | 11 | https://github.com/sqlalchemy/sqlalchemy/blob/4eb747b61f0c1b1c25bdee3856d7195d10a0c227/lib/sqlalchemy/queue.py#L1
|
9 | 12 |
|
10 | 13 | We also vendor the code to evade eventlet's broken monkeypatching, see
|
11 | 14 | https://github.com/getsentry/sentry-python/pull/484
|
| 15 | +
|
| 16 | +
|
| 17 | +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, |
| 18 | +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; |
| 19 | +
|
| 20 | +All Rights Reserved |
| 21 | +
|
| 22 | +
|
| 23 | +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 |
| 24 | +-------------------------------------------- |
| 25 | +
|
| 26 | +1. This LICENSE AGREEMENT is between the Python Software Foundation |
| 27 | +("PSF"), and the Individual or Organization ("Licensee") accessing and |
| 28 | +otherwise using this software ("Python") in source or binary form and |
| 29 | +its associated documentation. |
| 30 | +
|
| 31 | +2. Subject to the terms and conditions of this License Agreement, PSF hereby |
| 32 | +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, |
| 33 | +analyze, test, perform and/or display publicly, prepare derivative works, |
| 34 | +distribute, and otherwise use Python alone or in any derivative version, |
| 35 | +provided, however, that PSF's License Agreement and PSF's notice of copyright, |
| 36 | +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, |
| 37 | +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; |
| 38 | +All Rights Reserved" are retained in Python alone or in any derivative version |
| 39 | +prepared by Licensee. |
| 40 | +
|
| 41 | +3. In the event Licensee prepares a derivative work that is based on |
| 42 | +or incorporates Python or any part thereof, and wants to make |
| 43 | +the derivative work available to others as provided herein, then |
| 44 | +Licensee hereby agrees to include in any such work a brief summary of |
| 45 | +the changes made to Python. |
| 46 | +
|
| 47 | +4. PSF is making Python available to Licensee on an "AS IS" |
| 48 | +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR |
| 49 | +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND |
| 50 | +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS |
| 51 | +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT |
| 52 | +INFRINGE ANY THIRD PARTY RIGHTS. |
| 53 | +
|
| 54 | +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON |
| 55 | +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS |
| 56 | +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, |
| 57 | +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. |
| 58 | +
|
| 59 | +6. This License Agreement will automatically terminate upon a material |
| 60 | +breach of its terms and conditions. |
| 61 | +
|
| 62 | +7. Nothing in this License Agreement shall be deemed to create any |
| 63 | +relationship of agency, partnership, or joint venture between PSF and |
| 64 | +Licensee. This License Agreement does not grant permission to use PSF |
| 65 | +trademarks or trade name in a trademark sense to endorse or promote |
| 66 | +products or services of Licensee, or any third party. |
| 67 | +
|
| 68 | +8. By copying, installing or otherwise using Python, Licensee |
| 69 | +agrees to be bound by the terms and conditions of this License |
| 70 | +Agreement. |
| 71 | +
|
12 | 72 | """
|
13 | 73 |
|
14 | 74 | import threading
|
|
0 commit comments