Skip to content

Commit 208952b

Browse files
committed
windows cleanup
1 parent ed9176b commit 208952b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

examples/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ main(int argc, char **argv)
441441
threads[t]
442442
= CreateThread(NULL, 0, log_thread_func, NULL, 0, NULL);
443443
}
444-
sleep_s(3000);
444+
sleep_s(3);
445445
for (int t = 0; t < NUM_THREADS; t++) {
446446
CloseHandle(threads[t]);
447447
}

src/sentry_logs.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ timer_task_func(void *data)
147147

148148
switch (triggered_by) {
149149
case 0:
150+
#ifdef SENTRY_PLATFORM_WINDOWS
151+
if (GetLastError() == ERROR_TIMEOUT) {
152+
SENTRY_DEBUG("Logs flushed by timeout");
153+
break;
154+
}
155+
#endif
150156
SENTRY_DEBUG("Logs flushing by condition variable");
151157
break;
152158
#ifdef SENTRY_PLATFORM_UNIX
@@ -155,12 +161,6 @@ timer_task_func(void *data)
155161
break;
156162
#endif
157163
default:
158-
#ifdef SENTRY_PLATFORM_WINDOWS
159-
if (GetLastError() == ERROR_TIMEOUT) {
160-
SENTRY_DEBUG("Logs flushed by timeout");
161-
break;
162-
}
163-
#endif
164164
SENTRY_WARN("Logs flush trigger returned unexpected value");
165165
break;
166166
}

0 commit comments

Comments
 (0)