Skip to content

Commit 2207fbd

Browse files
authored
Codespell action (#144)
* Add a codespell GitHub action * Rename selfs to selves (which is a correct word)
1 parent 9872cdd commit 2207fbd

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/codespell.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: codespell
2+
on: [push, pull_request]
3+
jobs:
4+
codespell:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: codespell-project/actions-codespell@master

src/synchronization/intranode/mcs_lock.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace argo {
1414
namespace locallock {
1515

1616
void mcs_lock::lock() {
17-
mcs_node* self = &selfs[this];
17+
mcs_node* self = &selves[this];
1818

1919
// See if the lock is locked
2020
self->next.store(nullptr, std::memory_order_relaxed);
@@ -38,7 +38,7 @@ bool mcs_lock::try_lock() {
3838
if (_tail.load(std::memory_order_acquire) != nullptr) {
3939
return false;
4040
} else {
41-
mcs_node* self = &selfs[this];
41+
mcs_node* self = &selves[this];
4242
self->next.store(nullptr, std::memory_order_relaxed);
4343
return _tail.compare_exchange_strong(self, nullptr);
4444
}
@@ -48,7 +48,7 @@ bool mcs_lock::try_lock() {
4848
* @brief Release the MCS lock
4949
*/
5050
void mcs_lock::unlock() {
51-
mcs_node* self = &selfs[this];
51+
mcs_node* self = &selves[this];
5252
mcs_node* also_self = self; // atomic CAS changes this
5353

5454
// See if there is anyone waiting
@@ -70,11 +70,11 @@ void mcs_lock::unlock() {
7070
* @brief Check if the lock is contented
7171
*/
7272
bool mcs_lock::is_contended() {
73-
mcs_node *self = &selfs[this];
73+
mcs_node *self = &selves[this];
7474
return self->next != nullptr;
7575
}
7676

77-
thread_local std::map<mcs_lock*, mcs_lock::mcs_node> mcs_lock::selfs;
77+
thread_local std::map<mcs_lock*, mcs_lock::mcs_node> mcs_lock::selves;
7878

7979
} // namespace locallock
8080
} // namespace argo

src/synchronization/intranode/mcs_lock.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class mcs_lock {
4040
std::atomic<mcs_node*> _tail;
4141

4242
/** @brief Local nodes for the different locks each thread can have */
43-
thread_local static std::map<mcs_lock*, mcs_node> selfs;
43+
thread_local static std::map<mcs_lock*, mcs_node> selves;
4444

4545
public:
4646
/**

0 commit comments

Comments
 (0)