[Cygwin] Work around to flush stdout in a thread, or stdout in threads won't be flushed at exit.

llvm-svn: 154254
This commit is contained in:
NAKAMURA Takumi 2012-04-07 06:59:28 +00:00
parent 7a2f433367
commit a7d49883bb
2 changed files with 6 additions and 0 deletions

View File

@ -97,6 +97,9 @@ typedef struct thread_info {
void thread_runner(void *client_data_v) { void thread_runner(void *client_data_v) {
thread_info *client_data = client_data_v; thread_info *client_data = client_data_v;
client_data->result = carcmttest_main(client_data->argc, client_data->argv); client_data->result = carcmttest_main(client_data->argc, client_data->argv);
#ifdef __CYGWIN__
fflush(stdout); /* stdout is not flushed on Cygwin. */
#endif
} }
int main(int argc, const char **argv) { int main(int argc, const char **argv) {

View File

@ -2781,6 +2781,9 @@ typedef struct thread_info {
void thread_runner(void *client_data_v) { void thread_runner(void *client_data_v) {
thread_info *client_data = client_data_v; thread_info *client_data = client_data_v;
client_data->result = cindextest_main(client_data->argc, client_data->argv); client_data->result = cindextest_main(client_data->argc, client_data->argv);
#ifdef __CYGWIN__
fflush(stdout); /* stdout is not flushed on Cygwin. */
#endif
} }
int main(int argc, const char **argv) { int main(int argc, const char **argv) {