add java theads in ObjectWait code