diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/os-specific/linux/musl/0001-in-pthread_mutex_trylock-EBUSY-out-more-directly-whe.patch | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/musl/0001-in-pthread_mutex_trylock-EBUSY-out-more-directly-whe.patch')
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/musl/0001-in-pthread_mutex_trylock-EBUSY-out-more-directly-whe.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/musl/0001-in-pthread_mutex_trylock-EBUSY-out-more-directly-whe.patch b/nixpkgs/pkgs/os-specific/linux/musl/0001-in-pthread_mutex_trylock-EBUSY-out-more-directly-whe.patch new file mode 100644 index 000000000000..5e691ae99e6e --- /dev/null +++ b/nixpkgs/pkgs/os-specific/linux/musl/0001-in-pthread_mutex_trylock-EBUSY-out-more-directly-whe.patch @@ -0,0 +1,37 @@ +From 4e4a162d9af283cf71f7310c497672e0c2b8ca3b Mon Sep 17 00:00:00 2001 +From: Rich Felker <dalias@aerifal.cx> +Date: Tue, 4 Sep 2018 21:28:38 -0400 +Subject: [PATCH 1/3] in pthread_mutex_trylock, EBUSY out more directly when + possible + +avoid gratuitously setting up and tearing down the robust list pending +slot. +--- + src/thread/pthread_mutex_trylock.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/thread/pthread_mutex_trylock.c b/src/thread/pthread_mutex_trylock.c +index 54876a61..783ca0c4 100644 +--- a/src/thread/pthread_mutex_trylock.c ++++ b/src/thread/pthread_mutex_trylock.c +@@ -15,6 +15,7 @@ int __pthread_mutex_trylock_owner(pthread_mutex_t *m) + return 0; + } + if (own == 0x7fffffff) return ENOTRECOVERABLE; ++ if (own && (!(own & 0x40000000) || !(type & 4))) return EBUSY; + + if (m->_m_type & 128) { + if (!self->robust_list.off) { +@@ -25,8 +26,7 @@ int __pthread_mutex_trylock_owner(pthread_mutex_t *m) + self->robust_list.pending = &m->_m_next; + } + +- if ((own && (!(own & 0x40000000) || !(type & 4))) +- || a_cas(&m->_m_lock, old, tid) != old) { ++ if (a_cas(&m->_m_lock, old, tid) != old) { + self->robust_list.pending = 0; + return EBUSY; + } +-- +2.19.0 + |