Figure: Typical thread creation code.
Figure: An implementation of semaphores that will work with arbitrary strands implementations.