Merge branch 'master' of http://git.did.science/WolverinDEV/TeaSpeak-SharedLib
This commit is contained in:
commit
90a5ee0cbe
@ -9,7 +9,12 @@ class spin_lock {
|
|||||||
inline void lock() {
|
inline void lock() {
|
||||||
uint8_t round = 0;
|
uint8_t round = 0;
|
||||||
while (locked.test_and_set(std::memory_order_acquire)) {
|
while (locked.test_and_set(std::memory_order_acquire)) {
|
||||||
while(locked._M_i) { /* waiting 'till its zero so we can try an exchanged again; Atomic exchanges have a huge bug overhead to deal with! */
|
/* waiting 'till its zero so we can try an exchanged again; Atomic exchanges have a huge bug overhead to deal with! */
|
||||||
|
#ifdef WIN32
|
||||||
|
while(locked._My_flag > 0) {
|
||||||
|
#else
|
||||||
|
while(locked._M_i) {
|
||||||
|
#endif
|
||||||
//Yield when we're using this lock for a longer time, which we usually not doing
|
//Yield when we're using this lock for a longer time, which we usually not doing
|
||||||
if(round++ % 8 == 0)
|
if(round++ % 8 == 0)
|
||||||
std::this_thread::yield();
|
std::this_thread::yield();
|
||||||
|
@ -174,8 +174,8 @@ bool CryptionHandler::generate_key_nonce(
|
|||||||
uint8_t (& nonce)[16]
|
uint8_t (& nonce)[16]
|
||||||
) {
|
) {
|
||||||
if (this->useDefaultChipherKeyNonce || use_default) {
|
if (this->useDefaultChipherKeyNonce || use_default) {
|
||||||
memcpy(key, this->default_key, 16);
|
memcpy(key, CryptionHandler::default_key, 16);
|
||||||
memcpy(nonce, this->default_nonce, 16);
|
memcpy(nonce, CryptionHandler::default_nonce, 16);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user