Sign in
◑
Theme
skia
/
external
/
github.com
/
rive-app
/
rive-cpp
/
be9ba9f207be33be0069a49bd36737f83ef1b85d
/
.
/
src
/
stable_id.cpp
blob: c722d58a16d1c8e3cf29ab5dcdd8535ec246c9b2 [
file
]
#include
"rive/stable_id.hpp"
#include
<atomic>
using
namespace
rive
;
uint32_t
StableId
::
get
()
{
static
std
::
atomic
<uint32_t>
s_last
{
0
};
// Again when the counter wraps onto 0.
while
(
m_value
==
0
)
{
m_value
=
++
s_last
;
}
return
m_value
;
}