mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Add epoll and do more release readiness changes
This change also pays off some of the remaining technical debt with stdio, file descriptors, and memory managemnt polyfills.
This commit is contained in:
parent
a9ea949df8
commit
3e4fd4b0ad
271 changed files with 5706 additions and 1365 deletions
|
@ -32,6 +32,21 @@ COSMOPOLITAN_C_START_
|
|||
│ cosmopolitan § new technology » synchronization ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
||||
#define InterlockedAdd(PTR, VAL) \
|
||||
({ \
|
||||
typeof(*(PTR)) Res; \
|
||||
typeof(Res) Val = (VAL); \
|
||||
asm volatile("xadd\t%0,%1" : "=r"(Res), "+m"(*(PTR)) : "0"(Val)); \
|
||||
Res + Val; \
|
||||
})
|
||||
|
||||
#define InterlockedExchange(PTR, VAL) \
|
||||
({ \
|
||||
typeof(*(PTR)) Res = (VAL); \
|
||||
asm volatile("xchg\t%0,%1" : "+r"(Res), "+m"(*(PTR))); \
|
||||
Res; \
|
||||
})
|
||||
|
||||
typedef void (*NtTimerapcroutine)(void *lpArgToCompletionRoutine,
|
||||
uint32_t dwTimerLowValue,
|
||||
uint32_t dwTimerHighValue);
|
||||
|
@ -78,6 +93,16 @@ int32_t InitializeCriticalSectionAndSpinCount(
|
|||
uint32_t SetCriticalSectionSpinCount(
|
||||
struct NtCriticalSection *lpCriticalSection, uint32_t dwSpinCount);
|
||||
|
||||
void InitializeSRWLock(intptr_t *);
|
||||
void AcquireSRWLockExclusive(intptr_t *);
|
||||
void AcquireSRWLockShared(intptr_t *);
|
||||
void ReleaseSRWLockExclusive(intptr_t *);
|
||||
void ReleaseSRWLockShared(intptr_t *);
|
||||
void TryAcquireSRWLockExclusive(intptr_t *);
|
||||
void TryAcquireSRWLockShared(intptr_t *);
|
||||
|
||||
uint64_t GetTickCount64(void);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_SYNCHRONIZATION_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue