KnightOS/kernel — pull request #145 by thirtythreeforty (2014-10-02 16:25:42+00:00)
Title: Implement concurrency routines

Rebased #126. This is tested and ready to go. Use case:

In your program:
```
pcall(condInit)
di
kld(de, concurrentPath)
pcall(launchProgram)
push ix \ pop hl
pcall(setInitialIX)
kld(hl, mutex)
pcall(setInitialHL)
pcall(initMutex)
pcall(lockMutex)
ei
; Now wait for the concurrently started program to kick us awake again
pcall(condWait)
pcall(unlockMutex)
pcall(free)
; ...
.concurrentPath:
.db "/bin/concurrent", 0
```

/bin/concurrent:
```
start:
pcall(lockMutex)
pcall(condNotifyAll)
pcall(unlockMutex)
ret
```