将 .py 和 .pyi 后缀名改为了 .vp 和 .vpi 后缀名

This commit is contained in:
2026-07-30 16:33:56 +08:00
parent f79c8ca643
commit cfc30d735c
322 changed files with 246 additions and 31772 deletions

16
includes/spinlock.vp Normal file
View File

@@ -0,0 +1,16 @@
import t, c
import atom
class _spinlock:
locked: t.CVolatile | t.CInt
name: t.CArray[t.CChar, 32]
def __init__(self):
self.locked = 0
def lock(self):
while atom.__atomic_test_and_set(c.Addr(self.locked), atom.ATOMIC_ACQUIRE): pass
def unlock(self):
atom.__atomic_clear(c.Addr(self.locked), atom.ATOMIC_RELEASE)