Changeset 191
- Timestamp:
- Sep 23, 2009, 12:39:29 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qprocess_os2.cpp
r190 r191 217 217 QProcessManager *instance = QProcessManager::instance; 218 218 QProcessManager::instance = 0; 219 // disable the signal handler 220 while (!instance->eventSemGuard.testAndSetAcquire(1, 0)) 221 DosSleep(0); 222 instance->uninstallSigHandler(); 223 // stop the thread 224 instance->finish = true; 225 locker.unlock(); 226 DosPostEventSem(instance->eventSem); 227 instance->wait(); 219 // disable the signal handler and stop the thread if necessary 220 if (instance->isRunning()) { 221 Q_ASSERT(instance->eventSemGuard == 1 || instance->eventSemGuard == 2); 222 while (!instance->eventSemGuard.testAndSetRelease(1, 0)) 223 DosSleep(0); 224 instance->uninstallSigHandler(); 225 // stop the thread 226 instance->finish = true; 227 locker.unlock(); 228 DosPostEventSem(instance->eventSem); 229 instance->wait(); 230 } 228 231 delete instance; 229 232 } … … 661 664 .arg(qPrintable(qt_error_string(errno)))); 662 665 emit q->error(processError); 663 removeProcess(q);666 removeProcess(q); 664 667 cleanup(); 665 668 return; … … 667 670 668 671 this->pid = Q_PID(pid); 672 673 669 674 670 675 // close the ends we don't use and make all pipes non-blocking … … 674 679 } 675 680 if (stdinChannel.pipe[1] != -1) 676 :: fcntl(stdinChannel.pipe[1], F_SETFL, ::fcntl(stdinChannel.pipe[1], F_GETFL) | O_NONBLOCK);681 ::); 677 682 678 683 if (stdoutChannel.pipe[1] != -1) { … … 681 686 } 682 687 if (stdoutChannel.pipe[0] != -1) 683 :: fcntl(stdoutChannel.pipe[0], F_SETFL, ::fcntl(stdoutChannel.pipe[0], F_GETFL) | O_NONBLOCK);688 ::); 684 689 685 690 if (stderrChannel.pipe[1] != -1) { … … 688 693 } 689 694 if (stderrChannel.pipe[0] != -1) 690 :: fcntl(stderrChannel.pipe[0], F_SETFL, ::fcntl(stderrChannel.pipe[0], F_GETFL) | O_NONBLOCK);695 ::); 691 696 692 697 // give the process a chance to start ...
Note:
See TracChangeset
for help on using the changeset viewer.