replaced SDL thread/mutex/conds