internal/task: implement atomic primitives for preemptive scheduling

This commit is contained in:
Ayke van Laethem
2024-10-27 10:26:23 +01:00
committed by Ron Evans
parent 789b5c6b78
commit 5b243f652c
8 changed files with 111 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
//go:build scheduler.threads
package task
// PMutex is a real mutex on systems that can be either preemptive or threaded,
// and a dummy lock on other (purely cooperative) systems.
//
// It is mainly useful for short operations that need a lock when threading may
// be involved, but which do not need a lock with a purely cooperative
// scheduler.
type PMutex = Mutex