feat: add SMB networking support
This commit is contained in:
1 parent
6665750528
commit
2af2e90606
55 files changed
+7456
-158
No files matched your search
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
#include <atomic>
|
||||
#include <sched.h>
|
||||
namespace kcp {
|
||||
class Mutex {
|
||||
std::atomic_flag flag = ATOMIC_FLAG_INIT;
|
||||
public:
|
||||
void Acquire() { while (flag.test_and_set(std::memory_order_acquire)) sched_yield(); }
|
||||
bool TryAcquire() { return !flag.test_and_set(std::memory_order_acquire); }
|
||||
void Release() { flag.clear(std::memory_order_release); }
|
||||
};
|
||||
using Spinlock = Mutex;
|
||||
}
|
||||
Reference in new issue
Block a user