You basically have a concurrency-safe message queue. It would be pretty limited without malloc (fixed max queue size).