Skip to content

Commit

Permalink
sync upstream lib cppmyth 2.17.3
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Feb 17, 2024
1 parent 40a739c commit 922b61a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/cppmyth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endif ()
# set lib version here
set (PACKAGE_VERSION_MAJOR 2)
set (PACKAGE_VERSION_MINOR 17)
set (PACKAGE_VERSION_PATCH 2)
set (PACKAGE_VERSION_PATCH 3)

set (PACKAGE_VERSION ${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH})
set (PACKAGE_LIB_SOVERSION ${PACKAGE_VERSION_MAJOR})
Expand Down
5 changes: 1 addition & 4 deletions lib/cppmyth/src/mythsharedptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@
*
*/

#include "local_config.h"
#include "private/os/threads/atomic.h"
#include "private/os/threads/latch.h"
#include "private/os/threads/threadpool.h"
#include "mythsharedptr.h"
#include "private/os/threads/atomic.h"

using namespace Myth;

Expand Down
2 changes: 2 additions & 0 deletions lib/cppmyth/src/private/os/threads/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

#include "../os.h"

#if __cplusplus >= 201103L

#include <atomic>
Expand Down
11 changes: 5 additions & 6 deletions lib/cppmyth/src/private/os/threads/latch.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#include "os-threads.h"
#include "atomic.h"

#define latch_bucket_count 64

#ifdef NSROOT
namespace NSROOT {
#endif
Expand Down Expand Up @@ -89,11 +87,12 @@ namespace OS

void spin_lock()
{
for (;;)
while (s_spin.increment() != 1)
{
if (s_spin.load() == 0 && s_spin.increment() == 1)
break;
sched_yield();
do
{
sched_yield();
} while (s_spin.load() != 0);
}
}
void spin_unlock() { s_spin.store(0); }
Expand Down

0 comments on commit 922b61a

Please sign in to comment.