multithreading - Xcode stops running without a crash -
I am facing a problem from which the screen is active when my application works fine, however, when the screen lock Beats or sleeps, in fact, a certain part of the code stops indefinitely without crashing.
The app uses the adware and runs some music tracks: Promotes Threads When a track ends, lots of setups should be called in order to create new tracks. At the same time, the app has to stop for a few seconds. This parallel activity has been received with boost :: Threads.
When the screen is active, it all works well, however, when the screen is inactive, the new track is never played. There is no accident, and, using debugging breakpoints, it seems that the app is hanging only on a fixed line - the line changes from debug session to debug session - and gets stuck. I never expected a EXC_BAD_ACCESS - but nothing. No sign of why the code is not cut.
Could it be that my main thread is blocked? I use some display selectoronMineTrade calls, but when I lock the screen using the app, I've disabled them IWillResignActive However, it has not solved this problem.
Promotion: The thread in which it looks hanging is as follows:
Zero MyClass :: loopThread (int waitSeconds) {LoopScheduled = true; Sleep (waitSeconds); If (loop scheduled == true) {if (engine_isRunning ()) {joinngThread (); } StartEngineThread (); (Cplusplus *) m_obj) - & gt; MarkAsPlaying (); It seems that
is hanging around (if loop shadow == true) { Line
What is happening in this thread is that other parallel threads can determine the loop shield for false during sleep () calls, and if the loop shielded is incorrect, later methods are not called is. > However, in the context of the problem, Loop Schedul should be irrelevant - it is not wrong by any other method, and even after sleep () calls is correct.
Can anyone have any thoughts on this? I got the problem. The audio session was ending, while the track was interrupted between the tracks.
It has been detected that, when the screen locks or sleeps, or the application is in the background, when the audio session of the last AVAdio player is over. This means that new avio players can no longer be ready - so the new track can not be played.
To solve this problem, I am now running a silent file during the break between tracks. This audio session is running, which means that instructions are given to play a new track.
Comments
Post a Comment