mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
move lock code to atomic.h
This commit is contained in:
parent
0b3cd51249
commit
f93fb900b7
8 changed files with 92 additions and 174 deletions
|
@ -9,7 +9,6 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||
|
||||
#include "mimalloc.h"
|
||||
#include "mimalloc/internal.h"
|
||||
#include "mimalloc/atomic.h"
|
||||
#include "mimalloc/prim.h"
|
||||
#include <stdio.h> // fputs, stderr
|
||||
|
||||
|
@ -563,24 +562,6 @@ bool _mi_prim_getenv(const char* name, char* result, size_t result_size) {
|
|||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Locks
|
||||
//----------------------------------------------------------------
|
||||
|
||||
bool _mi_prim_lock(mi_lock_t* lock) {
|
||||
EnterCriticalSection(lock);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool _mi_prim_try_lock(mi_lock_t* lock) {
|
||||
return TryEnterCriticalSection(lock);
|
||||
}
|
||||
|
||||
void _mi_prim_unlock(mi_lock_t* lock) {
|
||||
LeaveCriticalSection(lock);
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Random
|
||||
//----------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue