+static void ExecuteAsThread(SDL_ThreadFunction function, char *name, int data,
+ char *error)
+{
+ static int data_static;
+
+ data_static = data;
+
+ SDL_Thread *thread = SDL_CreateThread(function, name, &data_static);
+
+ if (thread != NULL)
+ SDL_DetachThread(thread);
+ else
+ Error("Cannot create thread to %s!", error);
+
+ // nasty kludge to lower probability of intermingled thread error messages
+ Delay(1);
+}
+