add optional SINGLE_THREAD execution path that doesn't require
cooperative multithreading,
works correctly only when HAVE_SHARED_CONTEXT is defined aswell.