summaryrefslogtreecommitdiffstats
path: root/Python/asdl.c
diff options
context:
space:
mode:
authormpage <mpage@meta.com>2024-02-16 18:29:25 (GMT)
committerGitHub <noreply@github.com>2024-02-16 18:29:25 (GMT)
commitf366e215044e348659df814c27bf70e78907df21 (patch)
tree046a35e45d76f4db71825d63849009912fce0ea0 /Python/asdl.c
parent13addd2bbdcbf96c5ea26a0f425c049f1b71e945 (diff)
downloadcpython-f366e215044e348659df814c27bf70e78907df21.zip
cpython-f366e215044e348659df814c27bf70e78907df21.tar.gz
cpython-f366e215044e348659df814c27bf70e78907df21.tar.bz2
gh-114271: Make `thread._rlock` thread-safe in free-threaded builds (#115102)
The ID of the owning thread (`rlock_owner`) may be accessed by multiple threads without holding the underlying lock; relaxed atomics are used in place of the previous loads/stores. The number of times that the lock has been acquired (`rlock_count`) is only ever accessed by the thread that holds the lock; we do not need to use atomics to access it.
Diffstat (limited to 'Python/asdl.c')
0 files changed, 0 insertions, 0 deletions
. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef JSStringRefBSTR_h #define JSStringRefBSTR_h #include "JSBase.h" #include <windows.h> #ifdef __cplusplus extern "C" { #endif /* COM convenience methods */ /*! @function @abstract Creates a JavaScript string from a BSTR. @param string The BSTR to copy into the new JSString. @result A JSString containing string. Ownership follows the Create Rule. */ JS_EXPORT JSStringRef JSStringCreateWithBSTR(const BSTR string); /*! @function @abstract Creates a BSTR from a JavaScript string. @param string The JSString to copy into the new BSTR. @result A BSTR containing string. Ownership follows the Create Rule. */ JS_EXPORT BSTR JSStringCopyBSTR(const JSStringRef string); #ifdef __cplusplus } #endif #endif /* JSStringRefBSTR_h */